home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1990-06-05 | 19.4 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Jun 5 21:46:31 1990, modified Tue Jun 5 21:46:31 1990, creator 'MPS ', type ASCII, 19035 bytes "PrGeneralPlay.c" , at 0x4adb 578 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 50 72 47 65 6e 65 | 72 61 6c 50 6c 61 79 2e |..PrGene|ralPlay.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 80 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 4a 5b 00 | 00 02 42 a2 92 10 f7 a2 |.....J[.|..B.....|
|00000060| 92 10 f7 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 14 21 00 00 |........|.....!..|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 0d 23 0d 23 09 50 72 47 | 65 6e 65 72 61 6c 50 6c |.#.#.PrG|eneralPl|
|000000e0| 61 79 2e 63 0d 23 0d 23 | 09 50 72 47 65 6e 65 72 |ay.c.#.#|.PrGener|
|000000f0| 61 6c 50 6c 61 79 20 69 | 73 20 61 6e 20 65 78 61 |alPlay i|s an exa|
|00000100| 6d 70 6c 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |mple app|lication|
|00000110| 20 74 68 61 74 20 64 65 | 6d 6f 6e 73 74 72 61 74 | that de|monstrat|
|00000120| 65 73 20 74 68 65 20 75 | 73 65 0d 23 20 09 6f 66 |es the u|se.# .of|
|00000130| 20 50 72 47 65 6e 65 72 | 61 6c 27 73 20 6f 70 63 | PrGener|al's opc|
|00000140| 6f 64 65 73 3a 20 47 65 | 74 52 73 6c 44 61 74 61 |odes: Ge|tRslData|
|00000150| 2c 20 53 65 74 52 73 6c | 2c 20 47 65 74 52 6f 74 |, SetRsl|, GetRot|
|00000160| 6e 2c 20 44 72 61 66 74 | 42 69 74 73 2c 20 61 6e |n, Draft|Bits, an|
|00000170| 64 20 0d 23 20 20 20 4e | 6f 44 72 61 66 74 42 69 |d .# N|oDraftBi|
|00000180| 74 73 2e 20 20 46 6f 72 | 20 63 6f 6d 70 6c 65 74 |ts. For| complet|
|00000190| 65 20 64 65 74 61 69 6c | 73 20 61 62 6f 75 74 20 |e detail|s about |
|000001a0| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 61 6c 69 74 |the func|tionalit|
|000001b0| 79 20 6f 66 20 74 68 69 | 73 0d 23 09 61 70 70 6c |y of thi|s.#.appl|
|000001c0| 69 63 61 74 69 6f 6e 2c | 20 73 65 65 20 74 68 65 |ication,| see the|
|000001d0| 20 68 65 61 64 65 72 20 | 61 74 20 74 68 65 20 74 | header |at the t|
|000001e0| 6f 70 20 6f 66 20 74 68 | 65 20 50 72 47 65 6e 65 |op of th|e PrGene|
|000001f0| 72 61 6c 50 6c 61 79 50 | 72 69 6e 74 2e 63 20 66 |ralPlayP|rint.c f|
|00000200| 69 6c 65 2e 0d 23 0d 23 | 20 2d 2d 2d 2d 2d 2d 2d |ile..#.#| -------|
|00000210| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000220| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000230| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000240| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000250| 2d 2d 2d 2d 2d 2d 2d 20 | 20 0d 23 0d 23 09 56 65 |------- | .#.#.Ve|
|00000260| 72 73 69 6f 6e 73 3a 20 | 20 20 31 2e 30 30 09 09 |rsions: | 1.00..|
|00000270| 09 09 09 4a 75 6e 65 20 | 31 2c 20 31 39 39 30 0d |...June |1, 1990.|
|00000280| 23 0d 23 09 43 6f 6d 70 | 6f 6e 65 6e 74 73 3a 20 |#.#.Comp|onents: |
|00000290| 50 72 47 65 6e 65 72 61 | 6c 50 6c 61 79 2e 63 09 |PrGenera|lPlay.c.|
|000002a0| 09 09 4a 75 6e 65 20 31 | 2c 20 31 39 39 30 0d 23 |..June 1|, 1990.#|
|000002b0| 09 09 09 09 50 72 47 65 | 6e 65 72 61 6c 50 6c 61 |....PrGe|neralPla|
|000002c0| 79 50 72 69 6e 74 2e 63 | 09 4a 75 6e 65 20 31 2c |yPrint.c|.June 1,|
|000002d0| 20 31 39 39 30 0d 23 09 | 09 09 09 50 72 47 65 6e | 1990.#.|...PrGen|
|000002e0| 65 72 61 6c 50 6c 61 79 | 2e 68 09 09 09 4a 75 6e |eralPlay|.h...Jun|
|000002f0| 65 20 31 2c 20 31 39 39 | 30 0d 23 09 09 09 09 50 |e 1, 199|0.#....P|
|00000300| 72 47 65 6e 65 72 61 6c | 50 6c 61 79 2e 72 09 09 |rGeneral|Play.r..|
|00000310| 09 4a 75 6e 65 20 31 2c | 20 31 39 39 30 0d 23 0d |.June 1,| 1990.#.|
|00000320| 23 0d 23 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |#.#.Appl|e Macint|
|00000330| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|00000340| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|00000350| 23 09 43 6f 70 79 72 69 | 67 68 74 20 a9 20 31 39 |#.Copyri|ght . 19|
|00000360| 39 30 20 41 70 70 6c 65 | 20 43 6f 6d 70 75 74 65 |90 Apple| Compute|
|00000370| 72 2c 20 49 6e 63 2e 0d | 23 09 41 6c 6c 20 72 69 |r, Inc..|#.All ri|
|00000380| 67 68 74 73 20 72 65 73 | 65 72 76 65 64 2e 0d 23 |ghts res|erved..#|
|00000390| 0d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.-------|--------|
|000003a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000003b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000003c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000003d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2a |--------|-------*|
|000003e0| 2f 0d 0d 23 69 6e 63 6c | 75 64 65 20 3c 56 61 6c |/..#incl|ude <Val|
|000003f0| 75 65 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |ues.h>.#|include |
|00000400| 3c 54 79 70 65 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |<Types.h|>.#inclu|
|00000410| 64 65 20 3c 52 65 73 6f | 75 72 63 65 73 2e 68 3e |de <Reso|urces.h>|
|00000420| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 51 75 69 63 6b |.#includ|e <Quick|
|00000430| 44 72 61 77 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |Draw.h>.|#include|
|00000440| 20 3c 46 6f 6e 74 73 2e | 68 3e 0d 23 69 6e 63 6c | <Fonts.|h>.#incl|
|00000450| 75 64 65 20 3c 45 76 65 | 6e 74 73 2e 68 3e 0d 23 |ude <Eve|nts.h>.#|
|00000460| 69 6e 63 6c 75 64 65 20 | 3c 57 69 6e 64 6f 77 73 |include |<Windows|
|00000470| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 4d 65 |.h>.#inc|lude <Me|
|00000480| 6e 75 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |nus.h>.#|include |
|00000490| 3c 54 65 78 74 45 64 69 | 74 2e 68 3e 0d 23 69 6e |<TextEdi|t.h>.#in|
|000004a0| 63 6c 75 64 65 20 3c 44 | 69 61 6c 6f 67 73 2e 68 |clude <D|ialogs.h|
|000004b0| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 44 65 73 6b |>.#inclu|de <Desk|
|000004c0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 54 6f |.h>.#inc|lude <To|
|000004d0| 6f 6c 55 74 69 6c 73 2e | 68 3e 0d 23 69 6e 63 6c |olUtils.|h>.#incl|
|000004e0| 75 64 65 20 3c 4d 65 6d | 6f 72 79 2e 68 3e 0d 23 |ude <Mem|ory.h>.#|
|000004f0| 69 6e 63 6c 75 64 65 20 | 3c 53 65 67 4c 6f 61 64 |include |<SegLoad|
|00000500| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 46 69 |.h>.#inc|lude <Fi|
|00000510| 6c 65 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |les.h>.#|include |
|00000520| 3c 4f 53 55 74 69 6c 73 | 2e 68 3e 0d 23 69 6e 63 |<OSUtils|.h>.#inc|
|00000530| 6c 75 64 65 20 3c 4f 53 | 45 76 65 6e 74 73 2e 68 |lude <OS|Events.h|
|00000540| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 44 69 73 6b |>.#inclu|de <Disk|
|00000550| 49 6e 69 74 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |Init.h>.|#include|
|00000560| 20 3c 50 61 63 6b 61 67 | 65 73 2e 68 3e 0d 23 69 | <Packag|es.h>.#i|
|00000570| 6e 63 6c 75 64 65 20 3c | 54 72 61 70 73 2e 68 3e |nclude <|Traps.h>|
|00000580| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 50 72 69 6e 74 |.#includ|e <Print|
|00000590| 69 6e 67 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |ing.h>.#|include |
|000005a0| 3c 50 72 47 65 6e 65 72 | 61 6c 50 6c 61 79 2e 68 |<PrGener|alPlay.h|
|000005b0| 3e 09 09 2f 2a 20 62 72 | 69 6e 67 20 69 6e 20 61 |>../* br|ing in a|
|000005c0| 6c 6c 20 6f 66 20 74 68 | 65 20 23 64 65 66 69 6e |ll of th|e #defin|
|000005d0| 65 73 20 66 6f 72 20 50 | 72 47 65 6e 65 72 61 6c |es for P|rGeneral|
|000005e0| 50 6c 61 79 20 2a 2f 0d | 0d 23 64 65 66 69 6e 65 |Play */.|.#define|
|000005f0| 09 09 51 44 33 32 54 72 | 61 70 09 09 09 30 78 41 |..QD32Tr|ap...0xA|
|00000600| 42 30 33 0d 23 64 65 66 | 69 6e 65 09 09 55 6e 69 |B03.#def|ine..Uni|
|00000610| 6d 70 6c 65 6d 65 6e 74 | 65 64 09 09 30 78 41 38 |mplement|ed..0xA8|
|00000620| 39 46 0d 0d 0d 53 79 73 | 45 6e 76 52 65 63 09 67 |9F...Sys|EnvRec.g|
|00000630| 4d 61 63 3b 09 09 09 09 | 2f 2a 20 73 65 74 20 75 |Mac;....|/* set u|
|00000640| 70 20 62 79 20 49 6e 69 | 74 69 61 6c 69 7a 65 20 |p by Ini|tialize |
|00000650| 2a 2f 0d 42 6f 6f 6c 65 | 61 6e 09 09 67 48 61 73 |*/.Boole|an..gHas|
|00000660| 57 61 69 74 4e 65 78 74 | 45 76 65 6e 74 3b 09 2f |WaitNext|Event;./|
|00000670| 2a 20 73 65 74 20 75 70 | 20 62 79 20 49 6e 69 74 |* set up| by Init|
|00000680| 69 61 6c 69 7a 65 20 2a | 2f 0d 0d 54 48 50 72 69 |ialize *|/..THPri|
|00000690| 6e 74 09 09 67 50 72 52 | 65 63 48 64 6c 3b 0d 0d |nt..gPrR|ecHdl;..|
|000006a0| 42 6f 6f 6c 65 61 6e 09 | 09 67 48 69 67 68 52 65 |Boolean.|.gHighRe|
|000006b0| 73 6f 6c 75 74 69 6f 6e | 4f 4e 2c 20 20 20 2f 2a |solution|ON, /*|
|000006c0| 2a 20 20 54 68 65 73 65 | 20 67 6c 6f 62 61 6c 73 |* These| globals|
|000006d0| 20 61 72 65 20 73 65 74 | 20 75 70 20 62 79 20 49 | are set| up by I|
|000006e0| 6e 69 74 69 61 6c 69 7a | 65 20 20 2a 2a 2f 0d 09 |nitializ|e **/..|
|000006f0| 09 09 67 55 73 65 44 72 | 61 66 74 42 69 74 73 2c |..gUseDr|aftBits,|
|00000700| 0d 09 09 09 67 43 68 65 | 63 6b 46 6f 72 4c 61 6e |....gChe|ckForLan|
|00000710| 64 73 63 61 70 65 2c 0d | 09 09 09 67 44 72 61 66 |dscape,.|...gDraf|
|00000720| 74 42 69 74 73 48 61 73 | 42 65 65 6e 53 65 74 3b |tBitsHas|BeenSet;|
|00000730| 0d 09 09 09 67 50 72 47 | 65 6e 65 72 61 6c 4c 69 |....gPrG|eneralLi|
|00000740| 76 65 73 2c 0d 09 09 09 | 67 4c 61 6e 64 73 63 61 |ves,....|gLandsca|
|00000750| 70 65 4f 70 49 6d 70 6c | 2c 0d 09 09 09 67 44 72 |peOpImpl|,....gDr|
|00000760| 61 66 74 42 69 74 73 4f | 70 49 6d 70 6c 2c 0d 09 |aftBitsO|pImpl,..|
|00000770| 09 09 67 53 65 74 52 73 | 6c 4f 70 49 6d 70 6c 3b |..gSetRs|lOpImpl;|
|00000780| 0d 0d 73 68 6f 72 74 09 | 09 67 4f 72 69 67 69 6e |..short.|.gOrigin|
|00000790| 61 6c 44 72 69 76 65 72 | 56 65 72 73 3b 0d 0d 0d |alDriver|Vers;...|
|000007a0| 2f 2a 20 48 65 72 65 20 | 61 72 65 20 64 65 63 6c |/* Here |are decl|
|000007b0| 61 72 61 74 69 6f 6e 73 | 20 66 6f 72 20 61 6c 6c |arations| for all|
|000007c0| 20 6f 66 20 74 68 65 20 | 43 20 72 6f 75 74 69 6e | of the |C routin|
|000007d0| 65 73 2e 20 49 6e 20 4d | 50 57 20 33 2e 30 20 77 |es. In M|PW 3.0 w|
|000007e0| 65 20 63 61 6e 20 75 73 | 65 0d 20 20 20 61 63 74 |e can us|e. act|
|000007f0| 75 61 6c 20 70 72 6f 74 | 6f 74 79 70 65 73 20 66 |ual prot|otypes f|
|00000800| 6f 72 20 70 61 72 61 6d | 65 74 65 72 20 74 79 70 |or param|eter typ|
|00000810| 65 20 63 68 65 63 6b 69 | 6e 67 2e 20 2a 2f 0d 76 |e checki|ng. */.v|
|00000820| 6f 69 64 20 45 76 65 6e | 74 4c 6f 6f 70 28 20 76 |oid Even|tLoop( v|
|00000830| 6f 69 64 20 29 3b 0d 76 | 6f 69 64 20 44 6f 45 76 |oid );.v|oid DoEv|
|00000840| 65 6e 74 28 20 45 76 65 | 6e 74 52 65 63 6f 72 64 |ent( Eve|ntRecord|
|00000850| 20 2a 65 76 65 6e 74 20 | 29 3b 0d 76 6f 69 64 20 | *event |);.void |
|00000860| 47 65 74 47 6c 6f 62 61 | 6c 4d 6f 75 73 65 28 20 |GetGloba|lMouse( |
|00000870| 50 6f 69 6e 74 20 2a 6d | 6f 75 73 65 20 29 3b 0d |Point *m|ouse );.|
|00000880| 76 6f 69 64 20 41 64 6a | 75 73 74 4d 65 6e 75 73 |void Adj|ustMenus|
|00000890| 28 20 76 6f 69 64 20 29 | 3b 0d 76 6f 69 64 20 44 |( void )|;.void D|
|000008a0| 6f 4d 65 6e 75 43 6f 6d | 6d 61 6e 64 28 20 6c 6f |oMenuCom|mand( lo|
|000008b0| 6e 67 20 6d 65 6e 75 52 | 65 73 75 6c 74 20 29 3b |ng menuR|esult );|
|000008c0| 0d 76 6f 69 64 20 54 65 | 72 6d 69 6e 61 74 65 28 |.void Te|rminate(|
|000008d0| 20 76 6f 69 64 20 29 3b | 0d 76 6f 69 64 20 49 6e | void );|.void In|
|000008e0| 69 74 69 61 6c 69 7a 65 | 28 20 76 6f 69 64 20 29 |itialize|( void )|
|000008f0| 3b 0d 76 6f 69 64 20 46 | 6f 72 63 65 45 6e 76 69 |;.void F|orceEnvi|
|00000900| 72 6f 6e 73 28 20 76 6f | 69 64 20 29 3b 0d 42 6f |rons( vo|id );.Bo|
|00000910| 6f 6c 65 61 6e 20 49 73 | 44 41 57 69 6e 64 6f 77 |olean Is|DAWindow|
|00000920| 28 20 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |( Window|Ptr wind|
|00000930| 6f 77 20 29 3b 0d 42 6f | 6f 6c 65 61 6e 20 54 72 |ow );.Bo|olean Tr|
|00000940| 61 70 41 76 61 69 6c 61 | 62 6c 65 28 20 73 68 6f |apAvaila|ble( sho|
|00000950| 72 74 20 74 4e 75 6d 62 | 65 72 2c 20 54 72 61 70 |rt tNumb|er, Trap|
|00000960| 54 79 70 65 20 74 54 79 | 70 65 20 29 3b 0d 76 6f |Type tTy|pe );.vo|
|00000970| 69 64 20 41 6c 65 72 74 | 55 73 65 72 28 20 76 6f |id Alert|User( vo|
|00000980| 69 64 20 29 3b 0d 76 6f | 69 64 20 51 44 33 32 42 |id );.vo|id QD32B|
|00000990| 69 74 41 6c 65 72 74 55 | 73 65 72 20 28 20 76 6f |itAlertU|ser ( vo|
|000009a0| 69 64 20 29 3b 0d 0d 65 | 78 74 65 72 6e 20 42 6f |id );..e|xtern Bo|
|000009b0| 6f 6c 65 61 6e 20 74 65 | 73 74 46 6f 72 50 72 47 |olean te|stForPrG|
|000009c0| 65 6e 65 72 61 6c 20 28 | 20 76 6f 69 64 20 29 3b |eneral (| void );|
|000009d0| 0d 65 78 74 65 72 6e 20 | 76 6f 69 64 20 6e 6f 50 |.extern |void noP|
|000009e0| 72 47 65 6e 65 72 61 6c | 41 6c 65 72 74 20 28 20 |rGeneral|Alert ( |
|000009f0| 76 6f 69 64 20 29 3b 0d | 0d 0d 2f 2a 20 44 65 66 |void );.|../* Def|
|00000a00| 69 6e 65 20 48 69 57 72 | 64 20 61 6e 64 20 4c 6f |ine HiWr|d and Lo|
|00000a10| 57 72 64 20 6d 61 63 72 | 6f 73 20 66 6f 72 20 65 |Wrd macr|os for e|
|00000a20| 66 66 69 63 69 65 6e 63 | 79 2e 20 2a 2f 0d 23 64 |fficienc|y. */.#d|
|00000a30| 65 66 69 6e 65 20 48 69 | 57 72 64 28 61 4c 6f 6e |efine Hi|Wrd(aLon|
|00000a40| 67 29 09 28 28 28 61 4c | 6f 6e 67 29 20 3e 3e 20 |g).(((aL|ong) >> |
|00000a50| 31 36 29 20 26 20 30 78 | 46 46 46 46 29 0d 23 64 |16) & 0x|FFFF).#d|
|00000a60| 65 66 69 6e 65 20 4c 6f | 57 72 64 28 61 4c 6f 6e |efine Lo|Wrd(aLon|
|00000a70| 67 29 09 28 28 61 4c 6f | 6e 67 29 20 26 20 30 78 |g).((aLo|ng) & 0x|
|00000a80| 46 46 46 46 29 0d 0d 2f | 2a 20 44 65 66 69 6e 65 |FFFF)../|* Define|
|00000a90| 20 54 6f 70 4c 65 66 74 | 20 61 6e 64 20 42 6f 74 | TopLeft| and Bot|
|00000aa0| 52 69 67 68 74 20 6d 61 | 63 72 6f 73 20 66 6f 72 |Right ma|cros for|
|00000ab0| 20 63 6f 6e 76 65 6e 69 | 65 6e 63 65 2e 20 4e 6f | conveni|ence. No|
|00000ac0| 74 69 63 65 20 74 68 65 | 20 69 6d 70 6c 69 63 69 |tice the| implici|
|00000ad0| 74 0d 20 20 20 64 65 70 | 65 6e 64 65 6e 63 79 20 |t. dep|endency |
|00000ae0| 6f 6e 20 74 68 65 20 6f | 72 64 65 72 69 6e 67 20 |on the o|rdering |
|00000af0| 6f 66 20 66 69 65 6c 64 | 73 20 77 69 74 68 69 6e |of field|s within|
|00000b00| 20 61 20 52 65 63 74 20 | 2a 2f 0d 23 64 65 66 69 | a Rect |*/.#defi|
|00000b10| 6e 65 20 54 6f 70 4c 65 | 66 74 28 61 52 65 63 74 |ne TopLe|ft(aRect|
|00000b20| 29 09 28 2a 20 28 50 6f | 69 6e 74 20 2a 29 20 26 |).(* (Po|int *) &|
|00000b30| 28 61 52 65 63 74 29 2e | 74 6f 70 29 0d 23 64 65 |(aRect).|top).#de|
|00000b40| 66 69 6e 65 20 42 6f 74 | 52 69 67 68 74 28 61 52 |fine Bot|Right(aR|
|00000b50| 65 63 74 29 09 28 2a 20 | 28 50 6f 69 6e 74 20 2a |ect).(* |(Point *|
|00000b60| 29 20 26 28 61 52 65 63 | 74 29 2e 62 6f 74 74 6f |) &(aRec|t).botto|
|00000b70| 6d 29 0d 0d 0d 65 78 74 | 65 72 6e 20 76 6f 69 64 |m)...ext|ern void|
|00000b80| 20 5f 44 61 74 61 49 6e | 69 74 28 29 3b 0d 0d 2f | _DataIn|it();../|
|00000b90| 2a 20 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 69 |* This r|outine i|
|00000ba0| 73 20 70 61 72 74 20 6f | 66 20 74 68 65 20 4d 50 |s part o|f the MP|
|00000bb0| 57 20 72 75 6e 74 69 6d | 65 20 6c 69 62 72 61 72 |W runtim|e librar|
|00000bc0| 79 2e 20 54 68 69 73 20 | 65 78 74 65 72 6e 61 6c |y. This |external|
|00000bd0| 0d 20 20 20 72 65 66 65 | 72 65 6e 63 65 20 74 6f |. refe|rence to|
|00000be0| 20 69 74 20 69 73 20 64 | 6f 6e 65 20 73 6f 20 74 | it is d|one so t|
|00000bf0| 68 61 74 20 77 65 20 63 | 61 6e 20 75 6e 6c 6f 61 |hat we c|an unloa|
|00000c00| 64 20 69 74 73 20 73 65 | 67 6d 65 6e 74 2c 20 25 |d its se|gment, %|
|00000c10| 41 35 49 6e 69 74 2e 20 | 2a 2f 0d 0d 0d 23 70 72 |A5Init. |*/...#pr|
|00000c20| 61 67 6d 61 20 73 65 67 | 6d 65 6e 74 20 4d 61 69 |agma seg|ment Mai|
|00000c30| 6e 0d 6d 61 69 6e 28 29 | 0d 7b 0d 09 55 6e 6c 6f |n.main()|.{..Unlo|
|00000c40| 61 64 53 65 67 28 28 50 | 74 72 29 20 5f 44 61 74 |adSeg((P|tr) _Dat|
|00000c50| 61 49 6e 69 74 29 3b 09 | 09 2f 2a 20 6e 6f 74 65 |aInit);.|./* note|
|00000c60| 20 74 68 61 74 20 5f 44 | 61 74 61 49 6e 69 74 20 | that _D|ataInit |
|00000c70| 6d 75 73 74 20 6e 6f 74 | 20 62 65 20 69 6e 20 4d |must not| be in M|
|00000c80| 61 69 6e 21 20 2a 2f 0d | 09 0d 09 2f 2a 20 31 2e |ain! */.|.../* 1.|
|00000c90| 30 31 20 2d 20 63 61 6c | 6c 20 74 6f 20 46 6f 72 |01 - cal|l to For|
|00000ca0| 63 65 45 6e 76 69 72 6f | 6e 73 20 72 65 6d 6f 76 |ceEnviro|ns remov|
|00000cb0| 65 64 20 2a 2f 0d 09 0d | 09 2f 2a 09 49 66 20 79 |ed */...|./*.If y|
|00000cc0| 6f 75 20 68 61 76 65 20 | 73 74 61 63 6b 20 72 65 |ou have |stack re|
|00000cd0| 71 75 69 72 65 6d 65 6e | 74 73 20 74 68 61 74 20 |quiremen|ts that |
|00000ce0| 64 69 66 66 65 72 20 66 | 72 6f 6d 20 74 68 65 20 |differ f|rom the |
|00000cf0| 64 65 66 61 75 6c 74 2c | 0d 09 09 74 68 65 6e 20 |default,|...then |
|00000d00| 79 6f 75 20 63 6f 75 6c | 64 20 75 73 65 20 53 65 |you coul|d use Se|
|00000d10| 74 41 70 70 6c 4c 69 6d | 69 74 20 74 6f 20 69 6e |tApplLim|it to in|
|00000d20| 63 72 65 61 73 65 20 53 | 74 61 63 6b 53 70 61 63 |crease S|tackSpac|
|00000d30| 65 20 61 74 20 0d 09 09 | 74 68 69 73 20 70 6f 69 |e at ...|this poi|
|00000d40| 6e 74 2c 20 62 65 66 6f | 72 65 20 63 61 6c 6c 69 |nt, befo|re calli|
|00000d50| 6e 67 20 4d 61 78 41 70 | 70 6c 5a 6f 6e 65 2e 20 |ng MaxAp|plZone. |
|00000d60| 2a 2f 0d 09 4d 61 78 41 | 70 70 6c 5a 6f 6e 65 28 |*/..MaxA|pplZone(|
|00000d70| 29 3b 09 09 09 09 09 2f | 2a 20 65 78 70 61 6e 64 |);...../|* expand|
|00000d80| 20 74 68 65 20 68 65 61 | 70 20 73 6f 20 63 6f 64 | the hea|p so cod|
|00000d90| 65 20 73 65 67 6d 65 6e | 74 73 20 6c 6f 61 64 20 |e segmen|ts load |
|00000da0| 61 74 20 74 68 65 20 74 | 6f 70 20 2a 2f 0d 0d 09 |at the t|op */...|
|00000db0| 49 6e 69 74 69 61 6c 69 | 7a 65 28 29 3b 09 09 09 |Initiali|ze();...|
|00000dc0| 09 09 2f 2a 20 69 6e 69 | 74 69 61 6c 69 7a 65 20 |../* ini|tialize |
|00000dd0| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 2a 2f 0d 09 |the prog|ram */..|
|00000de0| 55 6e 6c 6f 61 64 53 65 | 67 28 28 50 74 72 29 20 |UnloadSe|g((Ptr) |
|00000df0| 49 6e 69 74 69 61 6c 69 | 7a 65 29 3b 09 2f 2a 20 |Initiali|ze);./* |
|00000e00| 6e 6f 74 65 20 74 68 61 | 74 20 49 6e 69 74 69 61 |note tha|t Initia|
|00000e10| 6c 69 7a 65 20 6d 75 73 | 74 20 6e 6f 74 20 62 65 |lize mus|t not be|
|00000e20| 20 69 6e 20 4d 61 69 6e | 21 20 2a 2f 0d 0d 09 45 | in Main|! */...E|
|00000e30| 76 65 6e 74 4c 6f 6f 70 | 28 29 3b 09 09 09 09 09 |ventLoop|();.....|
|00000e40| 2f 2a 20 63 61 6c 6c 20 | 74 68 65 20 6d 61 69 6e |/* call |the main|
|00000e50| 20 65 76 65 6e 74 20 6c | 6f 6f 70 20 2a 2f 0d 7d | event l|oop */.}|
|00000e60| 0d 0d 0d 2f 2a 09 47 65 | 74 20 65 76 65 6e 74 73 |.../*.Ge|t events|
|00000e70| 20 66 6f 72 65 76 65 72 | 2c 20 61 6e 64 20 68 61 | forever|, and ha|
|00000e80| 6e 64 6c 65 20 74 68 65 | 6d 20 62 79 20 63 61 6c |ndle the|m by cal|
|00000e90| 6c 69 6e 67 20 44 6f 45 | 76 65 6e 74 2e 0d 09 47 |ling DoE|vent...G|
|00000ea0| 65 74 20 74 68 65 20 65 | 76 65 6e 74 73 20 62 79 |et the e|vents by|
|00000eb0| 20 63 61 6c 6c 69 6e 67 | 20 57 61 69 74 4e 65 78 | calling| WaitNex|
|00000ec0| 74 45 76 65 6e 74 2c 20 | 69 66 20 69 74 27 73 20 |tEvent, |if it's |
|00000ed0| 61 76 61 69 6c 61 62 6c | 65 2c 20 6f 74 68 65 72 |availabl|e, other|
|00000ee0| 77 69 73 65 0d 09 62 79 | 20 63 61 6c 6c 69 6e 67 |wise..by| calling|
|00000ef0| 20 47 65 74 4e 65 78 74 | 45 76 65 6e 74 2e 20 20 | GetNext|Event. |
|00000f00| 2a 2f 0d 0d 23 70 72 61 | 67 6d 61 20 73 65 67 6d |*/..#pra|gma segm|
|00000f10| 65 6e 74 20 4d 61 69 6e | 0d 76 6f 69 64 20 45 76 |ent Main|.void Ev|
|00000f20| 65 6e 74 4c 6f 6f 70 28 | 29 0d 7b 0d 09 52 67 6e |entLoop(|).{..Rgn|
|00000f30| 48 61 6e 64 6c 65 09 63 | 75 72 73 6f 72 52 67 6e |Handle.c|ursorRgn|
|00000f40| 3b 0d 09 42 6f 6f 6c 65 | 61 6e 09 09 67 6f 74 45 |;..Boole|an..gotE|
|00000f50| 76 65 6e 74 3b 0d 09 45 | 76 65 6e 74 52 65 63 6f |vent;..E|ventReco|
|00000f60| 72 64 09 65 76 65 6e 74 | 3b 0d 0d 09 63 75 72 73 |rd.event|;...curs|
|00000f70| 6f 72 52 67 6e 20 3d 20 | 4e 65 77 52 67 6e 28 29 |orRgn = |NewRgn()|
|00000f80| 3b 09 09 09 2f 2a 20 77 | 65 d5 6c 6c 20 70 61 73 |;.../* w|e.ll pas|
|00000f90| 73 20 57 4e 45 20 61 6e | 20 65 6d 70 74 79 20 72 |s WNE an| empty r|
|00000fa0| 65 67 69 6f 6e 20 74 68 | 65 20 31 73 74 20 74 69 |egion th|e 1st ti|
|00000fb0| 6d 65 20 74 68 72 75 20 | 2a 2f 0d 09 64 6f 20 7b |me thru |*/..do {|
|00000fc0| 0d 09 09 2f 2a 20 75 73 | 65 20 57 4e 45 20 69 66 |.../* us|e WNE if|
|00000fd0| 20 69 74 20 69 73 20 61 | 76 61 69 6c 61 62 6c 65 | it is a|vailable|
|00000fe0| 20 2a 2f 0d 09 09 69 66 | 20 28 20 67 48 61 73 57 | */...if| ( gHasW|
|00000ff0| 61 69 74 4e 65 78 74 45 | 76 65 6e 74 20 29 20 09 |aitNextE|vent ) .|
|00001000| 09 09 0d 09 09 20 20 67 | 6f 74 45 76 65 6e 74 20 |..... g|otEvent |
|00001010| 3d 20 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 28 |= WaitNe|xtEvent(|
|00001020| 65 76 65 72 79 45 76 65 | 6e 74 2c 20 26 65 76 65 |everyEve|nt, &eve|
|00001030| 6e 74 2c 20 33 30 2c 20 | 63 75 72 73 6f 72 52 67 |nt, 30, |cursorRg|
|00001040| 6e 29 3b 0d 09 09 65 6c | 73 65 20 7b 0d 09 09 09 |n);...el|se {....|
|00001050| 53 79 73 74 65 6d 54 61 | 73 6b 28 29 3b 0d 09 09 |SystemTa|sk();...|
|00001060| 09 67 6f 74 45 76 65 6e | 74 20 3d 20 47 65 74 4e |.gotEven|t = GetN|
|00001070| 65 78 74 45 76 65 6e 74 | 28 65 76 65 72 79 45 76 |extEvent|(everyEv|
|00001080| 65 6e 74 2c 20 26 65 76 | 65 6e 74 29 3b 0d 09 09 |ent, &ev|ent);...|
|00001090| 7d 0d 09 09 0d 09 09 69 | 66 20 28 20 67 6f 74 45 |}......i|f ( gotE|
|000010a0| 76 65 6e 74 20 29 20 44 | 6f 45 76 65 6e 74 28 26 |vent ) D|oEvent(&|
|000010b0| 65 76 65 6e 74 29 3b 0d | 0d 09 09 20 20 7d 20 77 |event);.|... } w|
|000010c0| 68 69 6c 65 20 28 20 74 | 72 75 65 20 29 3b 09 2f |hile ( t|rue );./|
|000010d0| 2a 20 6c 6f 6f 70 20 66 | 6f 72 65 76 65 72 3b 20 |* loop f|orever; |
|000010e0| 77 65 20 71 75 69 74 20 | 76 69 61 20 45 78 69 74 |we quit |via Exit|
|000010f0| 54 6f 53 68 65 6c 6c 20 | 2a 2f 0d 7d 20 2f 2a 45 |ToShell |*/.} /*E|
|00001100| 76 65 6e 74 4c 6f 6f 70 | 2a 2f 0d 0d 0d 2f 2a 20 |ventLoop|*/.../* |
|00001110| 44 6f 20 74 68 65 20 72 | 69 67 68 74 20 74 68 69 |Do the r|ight thi|
|00001120| 6e 67 20 66 6f 72 20 61 | 6e 20 65 76 65 6e 74 2e |ng for a|n event.|
|00001130| 20 44 65 74 65 72 6d 69 | 6e 65 20 77 68 61 74 20 | Determi|ne what |
|00001140| 6b 69 6e 64 20 6f 66 20 | 65 76 65 6e 74 20 69 74 |kind of |event it|
|00001150| 20 69 73 2c 20 61 6e 64 | 20 63 61 6c 6c 0d 20 74 | is, and| call. t|
|00001160| 68 65 20 61 70 70 72 6f | 70 72 69 61 74 65 20 72 |he appro|priate r|
|00001170| 6f 75 74 69 6e 65 73 2e | 20 2a 2f 0d 0d 23 70 72 |outines.| */..#pr|
|00001180| 61 67 6d 61 20 73 65 67 | 6d 65 6e 74 20 4d 61 69 |agma seg|ment Mai|
|00001190| 6e 0d 76 6f 69 64 20 44 | 6f 45 76 65 6e 74 28 65 |n.void D|oEvent(e|
|000011a0| 76 65 6e 74 29 0d 09 45 | 76 65 6e 74 52 65 63 6f |vent)..E|ventReco|
|000011b0| 72 64 09 2a 65 76 65 6e | 74 3b 0d 7b 0d 09 73 68 |rd.*even|t;.{..sh|
|000011c0| 6f 72 74 09 09 70 61 72 | 74 2c 20 65 72 72 3b 0d |ort..par|t, err;.|
|000011d0| 09 57 69 6e 64 6f 77 50 | 74 72 09 77 69 6e 64 6f |.WindowP|tr.windo|
|000011e0| 77 3b 0d 09 42 6f 6f 6c | 65 61 6e 09 09 68 69 74 |w;..Bool|ean..hit|
|000011f0| 3b 0d 09 63 68 61 72 09 | 09 6b 65 79 3b 0d 09 50 |;..char.|.key;..P|
|00001200| 6f 69 6e 74 09 09 61 50 | 6f 69 6e 74 3b 0d 0d 09 |oint..aP|oint;...|
|00001210| 73 77 69 74 63 68 20 28 | 20 65 76 65 6e 74 2d 3e |switch (| event->|
|00001220| 77 68 61 74 20 29 20 7b | 0d 09 09 63 61 73 65 20 |what ) {|...case |
|00001230| 6d 6f 75 73 65 44 6f 77 | 6e 3a 0d 09 09 09 70 61 |mouseDow|n:....pa|
|00001240| 72 74 20 3d 20 46 69 6e | 64 57 69 6e 64 6f 77 28 |rt = Fin|dWindow(|
|00001250| 65 76 65 6e 74 2d 3e 77 | 68 65 72 65 2c 20 26 77 |event->w|here, &w|
|00001260| 69 6e 64 6f 77 29 3b 0d | 09 09 09 73 77 69 74 63 |indow);.|...switc|
|00001270| 68 20 28 20 70 61 72 74 | 20 29 20 7b 0d 09 09 09 |h ( part| ) {....|
|00001280| 09 63 61 73 65 20 69 6e | 4d 65 6e 75 42 61 72 3a |.case in|MenuBar:|
|00001290| 09 09 09 09 2f 2a 20 70 | 72 6f 63 65 73 73 20 61 |..../* p|rocess a|
|000012a0| 20 6d 6f 75 73 65 20 6d | 65 6e 75 20 63 6f 6d 6d | mouse m|enu comm|
|000012b0| 61 6e 64 20 28 69 66 20 | 61 6e 79 29 20 2a 2f 0d |and (if |any) */.|
|000012c0| 09 09 09 09 09 41 64 6a | 75 73 74 4d 65 6e 75 73 |.....Adj|ustMenus|
|000012d0| 28 29 3b 0d 09 09 09 09 | 09 44 6f 4d 65 6e 75 43 |();.....|.DoMenuC|
|000012e0| 6f 6d 6d 61 6e 64 28 4d | 65 6e 75 53 65 6c 65 63 |ommand(M|enuSelec|
|000012f0| 74 28 65 76 65 6e 74 2d | 3e 77 68 65 72 65 29 29 |t(event-|>where))|
|00001300| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|00001310| 09 09 63 61 73 65 20 69 | 6e 53 79 73 57 69 6e 64 |..case i|nSysWind|
|00001320| 6f 77 3a 09 09 09 2f 2a | 20 6c 65 74 20 74 68 65 |ow:.../*| let the|
|00001330| 20 73 79 73 74 65 6d 20 | 68 61 6e 64 6c 65 20 74 | system |handle t|
|00001340| 68 65 20 6d 6f 75 73 65 | 44 6f 77 6e 20 2a 2f 0d |he mouse|Down */.|
|00001350| 09 09 09 09 09 53 79 73 | 74 65 6d 43 6c 69 63 6b |.....Sys|temClick|
|00001360| 28 65 76 65 6e 74 2c 20 | 77 69 6e 64 6f 77 29 3b |(event, |window);|
|00001370| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|00001380| 09 63 61 73 65 20 69 6e | 43 6f 6e 74 65 6e 74 3a |.case in|Content:|
|00001390| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|000013a0| 09 63 61 73 65 20 69 6e | 44 72 61 67 3a 09 09 09 |.case in|Drag:...|
|000013b0| 09 2f 2a 20 70 61 73 73 | 20 73 63 72 65 65 6e 42 |./* pass| screenB|
|000013c0| 69 74 73 2e 62 6f 75 6e | 64 73 20 74 6f 20 67 65 |its.boun|ds to ge|
|000013d0| 74 20 61 6c 6c 20 67 44 | 65 76 69 63 65 73 20 2a |t all gD|evices *|
|000013e0| 2f 0d 09 09 09 09 09 44 | 72 61 67 57 69 6e 64 6f |/......D|ragWindo|
|000013f0| 77 28 77 69 6e 64 6f 77 | 2c 20 65 76 65 6e 74 2d |w(window|, event-|
|00001400| 3e 77 68 65 72 65 2c 20 | 26 71 64 2e 73 63 72 65 |>where, |&qd.scre|
|00001410| 65 6e 42 69 74 73 2e 62 | 6f 75 6e 64 73 29 3b 0d |enBits.b|ounds);.|
|00001420| 09 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 09 |.....bre|ak;.....|
|00001430| 63 61 73 65 20 69 6e 47 | 72 6f 77 3a 0d 09 09 09 |case inG|row:....|
|00001440| 09 09 62 72 65 61 6b 3b | 0d 09 09 09 09 63 61 73 |..break;|.....cas|
|00001450| 65 20 69 6e 5a 6f 6f 6d | 49 6e 3a 0d 09 09 09 09 |e inZoom|In:.....|
|00001460| 63 61 73 65 20 69 6e 5a | 6f 6f 6d 4f 75 74 3a 0d |case inZ|oomOut:.|
|00001470| 09 09 09 09 09 68 69 74 | 20 3d 20 54 72 61 63 6b |.....hit| = Track|
|00001480| 42 6f 78 28 77 69 6e 64 | 6f 77 2c 20 65 76 65 6e |Box(wind|ow, even|
|00001490| 74 2d 3e 77 68 65 72 65 | 2c 20 70 61 72 74 29 3b |t->where|, part);|
|000014a0| 0d 09 09 09 09 09 69 66 | 20 28 20 68 69 74 20 29 |......if| ( hit )|
|000014b0| 20 7b 0d 09 09 09 09 09 | 09 53 65 74 50 6f 72 74 | {......|.SetPort|
|000014c0| 28 77 69 6e 64 6f 77 29 | 3b 09 09 09 09 2f 2a 20 |(window)|;..../* |
|000014d0| 74 68 65 20 77 69 6e 64 | 6f 77 20 6d 75 73 74 20 |the wind|ow must |
|000014e0| 62 65 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 70 |be the c|urrent p|
|000014f0| 6f 72 74 2e 2e 2e 20 2a | 2f 0d 09 09 09 09 09 09 |ort... *|/.......|
|00001500| 45 72 61 73 65 52 65 63 | 74 28 26 77 69 6e 64 6f |EraseRec|t(&windo|
|00001510| 77 2d 3e 70 6f 72 74 52 | 65 63 74 29 3b 09 2f 2a |w->portR|ect);./*|
|00001520| 20 62 65 63 61 75 73 65 | 20 6f 66 20 61 20 62 75 | because| of a bu|
|00001530| 67 20 69 6e 20 5a 6f 6f | 6d 57 69 6e 64 6f 77 20 |g in Zoo|mWindow |
|00001540| 2a 2f 0d 09 09 09 09 09 | 09 5a 6f 6f 6d 57 69 6e |*/......|.ZoomWin|
|00001550| 64 6f 77 28 77 69 6e 64 | 6f 77 2c 20 70 61 72 74 |dow(wind|ow, part|
|00001560| 2c 20 74 72 75 65 29 3b | 09 2f 2a 20 6e 6f 74 65 |, true);|./* note|
|00001570| 20 74 68 61 74 20 77 65 | 20 69 6e 76 61 6c 69 64 | that we| invalid|
|00001580| 61 74 65 20 61 6e 64 20 | 65 72 61 73 65 2e 2e 2e |ate and |erase...|
|00001590| 20 2a 2f 0d 09 09 09 09 | 09 09 49 6e 76 61 6c 52 | */.....|..InvalR|
|000015a0| 65 63 74 28 26 77 69 6e | 64 6f 77 2d 3e 70 6f 72 |ect(&win|dow->por|
|000015b0| 74 52 65 63 74 29 3b 09 | 2f 2a 20 74 6f 20 6d 61 |tRect);.|/* to ma|
|000015c0| 6b 65 20 74 68 69 6e 67 | 73 20 6c 6f 6f 6b 20 62 |ke thing|s look b|
|000015d0| 65 74 74 65 72 20 6f 6e | 2d 73 63 72 65 65 6e 20 |etter on|-screen |
|000015e0| 2a 2f 0d 09 09 09 09 09 | 7d 0d 09 09 09 09 09 62 |*/......|}......b|
|000015f0| 72 65 61 6b 3b 0d 09 09 | 09 7d 0d 09 09 09 62 72 |reak;...|.}....br|
|00001600| 65 61 6b 3b 0d 09 09 63 | 61 73 65 20 6b 65 79 44 |eak;...c|ase keyD|
|00001610| 6f 77 6e 3a 0d 09 09 63 | 61 73 65 20 61 75 74 6f |own:...c|ase auto|
|00001620| 4b 65 79 3a 09 09 09 09 | 09 09 2f 2a 20 63 68 65 |Key:....|../* che|
|00001630| 63 6b 20 66 6f 72 20 6d | 65 6e 75 6b 65 79 20 65 |ck for m|enukey e|
|00001640| 71 75 69 76 61 6c 65 6e | 74 73 20 2a 2f 0d 09 09 |quivalen|ts */...|
|00001650| 09 6b 65 79 20 3d 20 65 | 76 65 6e 74 2d 3e 6d 65 |.key = e|vent->me|
|00001660| 73 73 61 67 65 20 26 20 | 63 68 61 72 43 6f 64 65 |ssage & |charCode|
|00001670| 4d 61 73 6b 3b 0d 09 09 | 09 69 66 20 28 20 65 76 |Mask;...|.if ( ev|
|00001680| 65 6e 74 2d 3e 6d 6f 64 | 69 66 69 65 72 73 20 26 |ent->mod|ifiers &|
|00001690| 20 63 6d 64 4b 65 79 20 | 29 09 09 09 2f 2a 20 43 | cmdKey |).../* C|
|000016a0| 6f 6d 6d 61 6e 64 20 6b | 65 79 20 64 6f 77 6e 20 |ommand k|ey down |
|000016b0| 2a 2f 0d 09 09 09 09 69 | 66 20 28 20 65 76 65 6e |*/.....i|f ( even|
|000016c0| 74 2d 3e 77 68 61 74 20 | 3d 3d 20 6b 65 79 44 6f |t->what |== keyDo|
|000016d0| 77 6e 20 29 20 7b 0d 09 | 09 09 09 09 41 64 6a 75 |wn ) {..|....Adju|
|000016e0| 73 74 4d 65 6e 75 73 28 | 29 3b 09 09 09 09 09 09 |stMenus(|);......|
|000016f0| 2f 2a 20 65 6e 61 62 6c | 65 2f 64 69 73 61 62 6c |/* enabl|e/disabl|
|00001700| 65 2f 63 68 65 63 6b 20 | 6d 65 6e 75 20 69 74 65 |e/check |menu ite|
|00001710| 6d 73 20 70 72 6f 70 65 | 72 6c 79 20 2a 2f 0d 09 |ms prope|rly */..|
|00001720| 09 09 09 09 44 6f 4d 65 | 6e 75 43 6f 6d 6d 61 6e |....DoMe|nuComman|
|00001730| 64 28 4d 65 6e 75 4b 65 | 79 28 6b 65 79 29 29 3b |d(MenuKe|y(key));|
|00001740| 0d 09 09 09 09 7d 0d 09 | 09 09 62 72 65 61 6b 3b |.....}..|..break;|
|00001750| 0d 09 09 63 61 73 65 20 | 61 63 74 69 76 61 74 65 |...case |activate|
|00001760| 45 76 74 3a 0d 09 09 09 | 62 72 65 61 6b 3b 0d 09 |Evt:....|break;..|
|00001770| 09 63 61 73 65 20 75 70 | 64 61 74 65 45 76 74 3a |.case up|dateEvt:|
|00001780| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 2f 2a 09 |....brea|k;.../*.|
|00001790| 31 2e 30 31 20 2d 20 49 | 74 20 69 73 20 6e 6f 74 |1.01 - I|t is not|
|000017a0| 20 61 20 62 61 64 20 69 | 64 65 61 20 74 6f 20 61 | a bad i|dea to a|
|000017b0| 74 20 6c 65 61 73 74 20 | 63 61 6c 6c 20 44 49 42 |t least |call DIB|
|000017c0| 61 64 4d 6f 75 6e 74 20 | 69 6e 20 72 65 73 70 6f |adMount |in respo|
|000017d0| 6e 73 65 0d 09 09 09 74 | 6f 20 61 20 64 69 73 6b |nse....t|o a disk|
|000017e0| 45 76 74 2c 20 73 6f 20 | 74 68 61 74 20 74 68 65 |Evt, so |that the|
|000017f0| 20 75 73 65 72 20 63 61 | 6e 20 66 6f 72 6d 61 74 | user ca|n format|
|00001800| 20 61 20 66 6c 6f 70 70 | 79 2e 20 2a 2f 0d 09 09 | a flopp|y. */...|
|00001810| 63 61 73 65 20 64 69 73 | 6b 45 76 74 3a 0d 09 09 |case dis|kEvt:...|
|00001820| 09 69 66 20 28 20 48 69 | 57 6f 72 64 28 65 76 65 |.if ( Hi|Word(eve|
|00001830| 6e 74 2d 3e 6d 65 73 73 | 61 67 65 29 20 21 3d 20 |nt->mess|age) != |
|00001840| 6e 6f 45 72 72 20 29 20 | 7b 0d 09 09 09 09 53 65 |noErr ) |{.....Se|
|00001850| 74 50 74 28 26 61 50 6f | 69 6e 74 2c 20 6b 44 49 |tPt(&aPo|int, kDI|
|00001860| 4c 65 66 74 2c 20 6b 44 | 49 54 6f 70 29 3b 0d 09 |Left, kD|ITop);..|
|00001870| 09 09 09 65 72 72 20 3d | 20 44 49 42 61 64 4d 6f |...err =| DIBadMo|
|00001880| 75 6e 74 28 61 50 6f 69 | 6e 74 2c 20 65 76 65 6e |unt(aPoi|nt, even|
|00001890| 74 2d 3e 6d 65 73 73 61 | 67 65 29 3b 0d 09 09 09 |t->messa|ge);....|
|000018a0| 7d 0d 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 63 61 |}....bre|ak;...ca|
|000018b0| 73 65 20 6b 4f 53 45 76 | 65 6e 74 3a 0d 09 09 09 |se kOSEv|ent:....|
|000018c0| 62 72 65 61 6b 3b 0d 09 | 7d 0d 7d 20 2f 2a 44 6f |break;..|}.} /*Do|
|000018d0| 45 76 65 6e 74 2a 2f 0d | 0d 0d 2f 2a 09 47 65 74 |Event*/.|../*.Get|
|000018e0| 20 74 68 65 20 67 6c 6f | 62 61 6c 20 63 6f 6f 72 | the glo|bal coor|
|000018f0| 64 69 6e 61 74 65 73 20 | 6f 66 20 74 68 65 20 6d |dinates |of the m|
|00001900| 6f 75 73 65 2e 20 57 68 | 65 6e 20 79 6f 75 20 63 |ouse. Wh|en you c|
|00001910| 61 6c 6c 20 4f 53 45 76 | 65 6e 74 41 76 61 69 6c |all OSEv|entAvail|
|00001920| 0d 09 69 74 20 77 69 6c | 6c 20 72 65 74 75 72 6e |..it wil|l return|
|00001930| 20 65 69 74 68 65 72 20 | 61 20 70 65 6e 64 69 6e | either |a pendin|
|00001940| 67 20 65 76 65 6e 74 20 | 6f 72 20 61 20 6e 75 6c |g event |or a nul|
|00001950| 6c 20 65 76 65 6e 74 2e | 20 49 6e 20 65 69 74 68 |l event.| In eith|
|00001960| 65 72 20 63 61 73 65 2c | 0d 09 74 68 65 20 77 68 |er case,|..the wh|
|00001970| 65 72 65 20 66 69 65 6c | 64 20 6f 66 20 74 68 65 |ere fiel|d of the|
|00001980| 20 65 76 65 6e 74 20 72 | 65 63 6f 72 64 20 77 69 | event r|ecord wi|
|00001990| 6c 6c 20 63 6f 6e 74 61 | 69 6e 20 74 68 65 20 63 |ll conta|in the c|
|000019a0| 75 72 72 65 6e 74 20 70 | 6f 73 69 74 69 6f 6e 0d |urrent p|osition.|
|000019b0| 09 6f 66 20 74 68 65 20 | 6d 6f 75 73 65 20 69 6e |.of the |mouse in|
|000019c0| 20 67 6c 6f 62 61 6c 20 | 63 6f 6f 72 64 69 6e 61 | global |coordina|
|000019d0| 74 65 73 20 61 6e 64 20 | 74 68 65 20 6d 6f 64 69 |tes and |the modi|
|000019e0| 66 69 65 72 73 20 66 69 | 65 6c 64 20 77 69 6c 6c |fiers fi|eld will|
|000019f0| 20 72 65 66 6c 65 63 74 | 0d 09 74 68 65 20 63 75 | reflect|..the cu|
|00001a00| 72 72 65 6e 74 20 73 74 | 61 74 65 20 6f 66 20 74 |rrent st|ate of t|
|00001a10| 68 65 20 6d 6f 64 69 66 | 69 65 72 73 2e 20 41 6e |he modif|iers. An|
|00001a20| 6f 74 68 65 72 20 77 61 | 79 20 74 6f 20 67 65 74 |other wa|y to get|
|00001a30| 20 74 68 65 20 67 6c 6f | 62 61 6c 0d 09 63 6f 6f | the glo|bal..coo|
|00001a40| 72 64 69 6e 61 74 65 73 | 20 69 73 20 74 6f 20 63 |rdinates| is to c|
|00001a50| 61 6c 6c 20 47 65 74 4d | 6f 75 73 65 20 61 6e 64 |all GetM|ouse and|
|00001a60| 20 4c 6f 63 61 6c 54 6f | 47 6c 6f 62 61 6c 2c 20 | LocalTo|Global, |
|00001a70| 62 75 74 20 74 68 61 74 | 20 72 65 71 75 69 72 65 |but that| require|
|00001a80| 73 0d 09 62 65 69 6e 67 | 20 73 75 72 65 20 74 68 |s..being| sure th|
|00001a90| 61 74 20 74 68 65 50 6f | 72 74 20 69 73 20 73 65 |at thePo|rt is se|
|00001aa0| 74 20 74 6f 20 61 20 76 | 61 6c 69 64 20 70 6f 72 |t to a v|alid por|
|00001ab0| 74 2e 20 2a 2f 0d 0d 23 | 70 72 61 67 6d 61 20 73 |t. */..#|pragma s|
|00001ac0| 65 67 6d 65 6e 74 20 4d | 61 69 6e 0d 76 6f 69 64 |egment M|ain.void|
|00001ad0| 20 47 65 74 47 6c 6f 62 | 61 6c 4d 6f 75 73 65 28 | GetGlob|alMouse(|
|00001ae0| 6d 6f 75 73 65 29 0d 09 | 50 6f 69 6e 74 09 2a 6d |mouse)..|Point.*m|
|00001af0| 6f 75 73 65 3b 0d 7b 0d | 09 45 76 65 6e 74 52 65 |ouse;.{.|.EventRe|
|00001b00| 63 6f 72 64 09 65 76 65 | 6e 74 3b 0d 09 0d 09 4f |cord.eve|nt;....O|
|00001b10| 53 45 76 65 6e 74 41 76 | 61 69 6c 28 6b 4e 6f 45 |SEventAv|ail(kNoE|
|00001b20| 76 65 6e 74 73 2c 20 26 | 65 76 65 6e 74 29 3b 09 |vents, &|event);.|
|00001b30| 2f 2a 20 77 65 20 61 72 | 65 6e 27 74 20 69 6e 74 |/* we ar|en't int|
|00001b40| 65 72 65 73 74 65 64 20 | 69 6e 20 61 6e 79 20 65 |erested |in any e|
|00001b50| 76 65 6e 74 73 20 2a 2f | 0d 09 2a 6d 6f 75 73 65 |vents */|..*mouse|
|00001b60| 20 3d 20 65 76 65 6e 74 | 2e 77 68 65 72 65 3b 09 | = event|.where;.|
|00001b70| 09 09 09 2f 2a 20 6a 75 | 73 74 20 74 68 65 20 6d |.../* ju|st the m|
|00001b80| 6f 75 73 65 20 70 6f 73 | 69 74 69 6f 6e 20 2a 2f |ouse pos|ition */|
|00001b90| 0d 7d 20 2f 2a 47 65 74 | 47 6c 6f 62 61 6c 4d 6f |.} /*Get|GlobalMo|
|00001ba0| 75 73 65 2a 2f 0d 0d 0d | 2f 2a 09 45 6e 61 62 6c |use*/...|/*.Enabl|
|00001bb0| 65 20 61 6e 64 20 64 69 | 73 61 62 6c 65 20 6d 65 |e and di|sable me|
|00001bc0| 6e 75 73 20 62 61 73 65 | 64 20 6f 6e 20 74 68 65 |nus base|d on the|
|00001bd0| 20 63 75 72 72 65 6e 74 | 20 73 74 61 74 65 2e 0d | current| state..|
|00001be0| 09 54 68 65 20 75 73 65 | 72 20 63 61 6e 20 6f 6e |.The use|r can on|
|00001bf0| 6c 79 20 73 65 6c 65 63 | 74 20 65 6e 61 62 6c 65 |ly selec|t enable|
|00001c00| 64 20 6d 65 6e 75 20 69 | 74 65 6d 73 2e 20 57 65 |d menu i|tems. We|
|00001c10| 20 73 65 74 20 75 70 20 | 61 6c 6c 20 74 68 65 20 | set up |all the |
|00001c20| 6d 65 6e 75 20 69 74 65 | 6d 73 0d 09 62 65 66 6f |menu ite|ms..befo|
|00001c30| 72 65 20 63 61 6c 6c 69 | 6e 67 20 4d 65 6e 75 53 |re calli|ng MenuS|
|00001c40| 65 6c 65 63 74 20 6f 72 | 20 4d 65 6e 75 4b 65 79 |elect or| MenuKey|
|00001c50| 2c 20 73 69 6e 63 65 20 | 74 68 65 73 65 20 61 72 |, since |these ar|
|00001c60| 65 20 74 68 65 20 6f 6e | 6c 79 20 74 69 6d 65 73 |e the on|ly times|
|00001c70| 20 74 68 61 74 0d 09 61 | 20 6d 65 6e 75 20 69 74 | that..a| menu it|
|00001c80| 65 6d 20 63 61 6e 20 62 | 65 20 73 65 6c 65 63 74 |em can b|e select|
|00001c90| 65 64 2e 20 4e 6f 74 65 | 20 74 68 61 74 20 4d 65 |ed. Note| that Me|
|00001ca0| 6e 75 53 65 6c 65 63 74 | 20 69 73 20 61 6c 73 6f |nuSelect| is also|
|00001cb0| 20 74 68 65 20 6f 6e 6c | 79 20 74 69 6d 65 0d 09 | the onl|y time..|
|00001cc0| 74 68 65 20 75 73 65 72 | 20 77 69 6c 6c 20 73 65 |the user| will se|
|00001cd0| 65 20 6d 65 6e 75 20 69 | 74 65 6d 73 2e 20 54 68 |e menu i|tems. Th|
|00001ce0| 69 73 20 61 70 70 72 6f | 61 63 68 20 74 6f 20 64 |is appro|ach to d|
|00001cf0| 65 63 69 64 69 6e 67 20 | 77 68 61 74 20 65 6e 61 |eciding |what ena|
|00001d00| 62 6c 65 2f 0d 09 64 69 | 73 61 62 6c 65 20 73 74 |ble/..di|sable st|
|00001d10| 61 74 65 20 61 20 6d 65 | 6e 75 20 69 74 65 6d 20 |ate a me|nu item |
|00001d20| 68 61 73 20 74 68 65 20 | 61 64 76 61 6e 74 61 67 |has the |advantag|
|00001d30| 65 20 6f 66 20 63 6f 6e | 63 65 6e 74 72 61 74 69 |e of con|centrati|
|00001d40| 6e 67 20 61 6c 6c 0d 09 | 74 68 65 20 64 65 63 69 |ng all..|the deci|
|00001d50| 73 69 6f 6e 2d 6d 61 6b | 69 6e 67 20 69 6e 20 6f |sion-mak|ing in o|
|00001d60| 6e 65 20 72 6f 75 74 69 | 6e 65 2c 20 61 73 20 6f |ne routi|ne, as o|
|00001d70| 70 70 6f 73 65 64 20 74 | 6f 20 62 65 69 6e 67 20 |pposed t|o being |
|00001d80| 73 70 72 65 61 64 20 74 | 68 72 6f 75 67 68 6f 75 |spread t|hroughou|
|00001d90| 74 0d 09 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |t..the a|pplicati|
|00001da0| 6f 6e 2e 20 4f 74 68 65 | 72 20 61 70 70 6c 69 63 |on. Othe|r applic|
|00001db0| 61 74 69 6f 6e 20 64 65 | 73 69 67 6e 73 20 6d 61 |ation de|signs ma|
|00001dc0| 79 20 74 61 6b 65 20 61 | 20 64 69 66 66 65 72 65 |y take a| differe|
|00001dd0| 6e 74 20 61 70 70 72 6f | 61 63 68 0d 09 74 68 61 |nt appro|ach..tha|
|00001de0| 74 20 69 73 20 6a 75 73 | 74 20 61 73 20 76 61 6c |t is jus|t as val|
|00001df0| 69 64 2e 20 2a 2f 0d 0d | 23 70 72 61 67 6d 61 20 |id. */..|#pragma |
|00001e00| 73 65 67 6d 65 6e 74 20 | 4d 61 69 6e 0d 76 6f 69 |segment |Main.voi|
|00001e10| 64 20 41 64 6a 75 73 74 | 4d 65 6e 75 73 28 29 0d |d Adjust|Menus().|
|00001e20| 7b 0d 09 57 69 6e 64 6f | 77 50 74 72 09 77 69 6e |{..Windo|wPtr.win|
|00001e30| 64 6f 77 3b 0d 09 4d 65 | 6e 75 48 61 6e 64 6c 65 |dow;..Me|nuHandle|
|00001e40| 09 6d 65 6e 75 3b 0d 0d | 09 77 69 6e 64 6f 77 20 |.menu;..|.window |
|00001e50| 3d 20 46 72 6f 6e 74 57 | 69 6e 64 6f 77 28 29 3b |= FrontW|indow();|
|00001e60| 0d 0d 09 6d 65 6e 75 20 | 3d 20 47 65 74 4d 48 61 |...menu |= GetMHa|
|00001e70| 6e 64 6c 65 28 6d 46 69 | 6c 65 29 3b 0d 0d 20 20 |ndle(mFi|le);.. |
|00001e80| 20 20 69 66 20 28 20 49 | 73 44 41 57 69 6e 64 6f | if ( I|sDAWindo|
|00001e90| 77 28 77 69 6e 64 6f 77 | 29 20 29 20 7b 09 09 2f |w(window|) ) {../|
|00001ea0| 2a 20 77 65 20 63 61 6e | 20 61 6c 6c 6f 77 20 64 |* we can| allow d|
|00001eb0| 65 73 6b 20 61 63 63 65 | 73 73 6f 72 69 65 73 20 |esk acce|ssories |
|00001ec0| 74 6f 20 62 65 20 63 6c | 6f 73 65 64 20 66 72 6f |to be cl|osed fro|
|00001ed0| 6d 20 74 68 65 20 6d 65 | 6e 75 20 2a 2f 0d 09 09 |m the me|nu */...|
|00001ee0| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |DisableI|tem(menu|
|00001ef0| 2c 20 69 4e 65 77 29 3b | 0d 09 09 44 69 73 61 62 |, iNew);|...Disab|
|00001f00| 6c 65 49 74 65 6d 28 6d | 65 6e 75 2c 20 69 4f 70 |leItem(m|enu, iOp|
|00001f10| 65 6e 29 3b 0d 09 09 44 | 69 73 61 62 6c 65 49 74 |en);...D|isableIt|
|00001f20| 65 6d 28 6d 65 6e 75 2c | 20 69 53 61 76 65 29 3b |em(menu,| iSave);|
|00001f30| 0d 09 09 44 69 73 61 62 | 6c 65 49 74 65 6d 28 6d |...Disab|leItem(m|
|00001f40| 65 6e 75 2c 20 69 53 61 | 76 65 41 73 29 3b 0d 09 |enu, iSa|veAs);..|
|00001f50| 09 44 69 73 61 62 6c 65 | 49 74 65 6d 28 6d 65 6e |.Disable|Item(men|
|00001f60| 75 2c 20 69 52 65 76 65 | 72 74 29 3b 0d 09 09 44 |u, iReve|rt);...D|
|00001f70| 69 73 61 62 6c 65 49 74 | 65 6d 28 6d 65 6e 75 2c |isableIt|em(menu,|
|00001f80| 20 69 50 61 67 65 53 65 | 74 75 70 29 3b 0d 09 09 | iPageSe|tup);...|
|00001f90| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |DisableI|tem(menu|
|00001fa0| 2c 20 69 50 72 69 6e 74 | 29 3b 0d 09 09 45 6e 61 |, iPrint|);...Ena|
|00001fb0| 62 6c 65 49 74 65 6d 28 | 6d 65 6e 75 2c 20 69 43 |bleItem(|menu, iC|
|00001fc0| 6c 6f 73 65 29 3b 0d 09 | 7d 0d 09 65 6c 73 65 20 |lose);..|}..else |
|00001fd0| 7b 0d 09 09 45 6e 61 62 | 6c 65 49 74 65 6d 28 6d |{...Enab|leItem(m|
|00001fe0| 65 6e 75 2c 20 69 50 61 | 67 65 53 65 74 75 70 29 |enu, iPa|geSetup)|
|00001ff0| 3b 0d 09 09 45 6e 61 62 | 6c 65 49 74 65 6d 28 6d |;...Enab|leItem(m|
|00002000| 65 6e 75 2c 20 69 50 72 | 69 6e 74 29 3b 0d 09 7d |enu, iPr|int);..}|
|00002010| 0d 0d 09 6d 65 6e 75 20 | 3d 20 47 65 74 4d 48 61 |...menu |= GetMHa|
|00002020| 6e 64 6c 65 28 6d 45 64 | 69 74 29 3b 0d 09 69 66 |ndle(mEd|it);..if|
|00002030| 20 28 20 49 73 44 41 57 | 69 6e 64 6f 77 28 77 69 | ( IsDAW|indow(wi|
|00002040| 6e 64 6f 77 29 20 29 20 | 7b 09 09 2f 2a 20 61 20 |ndow) ) |{../* a |
|00002050| 64 65 73 6b 20 61 63 63 | 65 73 73 6f 72 79 20 6d |desk acc|essory m|
|00002060| 69 67 68 74 20 6e 65 65 | 64 20 74 68 65 20 65 64 |ight nee|d the ed|
|00002070| 69 74 20 6d 65 6e 75 c9 | 20 2a 2f 0d 09 09 45 6e |it menu.| */...En|
|00002080| 61 62 6c 65 49 74 65 6d | 28 6d 65 6e 75 2c 20 69 |ableItem|(menu, i|
|00002090| 55 6e 64 6f 29 3b 0d 09 | 09 45 6e 61 62 6c 65 49 |Undo);..|.EnableI|
|000020a0| 74 65 6d 28 6d 65 6e 75 | 2c 20 69 43 75 74 29 3b |tem(menu|, iCut);|
|000020b0| 0d 09 09 45 6e 61 62 6c | 65 49 74 65 6d 28 6d 65 |...Enabl|eItem(me|
|000020c0| 6e 75 2c 20 69 43 6f 70 | 79 29 3b 0d 09 09 45 6e |nu, iCop|y);...En|
|000020d0| 61 62 6c 65 49 74 65 6d | 28 6d 65 6e 75 2c 20 69 |ableItem|(menu, i|
|000020e0| 43 6c 65 61 72 29 3b 0d | 09 09 45 6e 61 62 6c 65 |Clear);.|..Enable|
|000020f0| 49 74 65 6d 28 6d 65 6e | 75 2c 20 69 50 61 73 74 |Item(men|u, iPast|
|00002100| 65 29 3b 0d 09 7d 20 65 | 6c 73 65 20 7b 09 09 09 |e);..} e|lse {...|
|00002110| 09 09 09 2f 2a 20 c9 62 | 75 74 20 77 65 20 64 6f |.../* .b|ut we do|
|00002120| 6e d5 74 20 75 73 65 20 | 69 74 20 2a 2f 0d 09 09 |n.t use |it */...|
|00002130| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |DisableI|tem(menu|
|00002140| 2c 20 69 55 6e 64 6f 29 | 3b 0d 09 09 44 69 73 61 |, iUndo)|;...Disa|
|00002150| 62 6c 65 49 74 65 6d 28 | 6d 65 6e 75 2c 20 69 43 |bleItem(|menu, iC|
|00002160| 75 74 29 3b 0d 09 09 44 | 69 73 61 62 6c 65 49 74 |ut);...D|isableIt|
|00002170| 65 6d 28 6d 65 6e 75 2c | 20 69 43 6f 70 79 29 3b |em(menu,| iCopy);|
|00002180| 0d 09 09 44 69 73 61 62 | 6c 65 49 74 65 6d 28 6d |...Disab|leItem(m|
|00002190| 65 6e 75 2c 20 69 43 6c | 65 61 72 29 3b 0d 09 09 |enu, iCl|ear);...|
|000021a0| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |DisableI|tem(menu|
|000021b0| 2c 20 69 50 61 73 74 65 | 29 3b 0d 09 7d 0d 0d 09 |, iPaste|);..}...|
|000021c0| 6d 65 6e 75 20 3d 20 47 | 65 74 4d 48 61 6e 64 6c |menu = G|etMHandl|
|000021d0| 65 28 6d 50 72 47 65 6e | 65 72 61 6c 29 3b 0d 09 |e(mPrGen|eral);..|
|000021e0| 69 66 20 28 20 67 50 72 | 47 65 6e 65 72 61 6c 4c |if ( gPr|GeneralL|
|000021f0| 69 76 65 73 29 20 0d 09 | 7b 09 0d 09 20 20 20 20 |ives) ..|{... |
|00002200| 2f 2f 20 20 49 66 20 74 | 68 65 20 70 61 72 74 69 |// If t|he parti|
|00002210| 63 75 6c 61 72 20 6f 70 | 63 6f 64 65 20 69 73 20 |cular op|code is |
|00002220| 73 75 70 70 6f 72 74 65 | 64 20 62 79 20 74 68 65 |supporte|d by the|
|00002230| 20 63 75 72 72 65 6e 74 | 20 70 72 69 6e 74 65 72 | current| printer|
|00002240| 20 64 72 69 76 65 72 2c | 0d 09 09 2f 2f 20 20 65 | driver,|...// e|
|00002250| 6e 61 62 6c 65 20 74 68 | 65 20 6d 65 6e 75 20 69 |nable th|e menu i|
|00002260| 74 65 6d 2c 20 6f 74 68 | 65 72 77 69 73 65 20 64 |tem, oth|erwise d|
|00002270| 69 73 2d 61 62 6c 65 20 | 69 74 2e 2e 2e 2e 0d 09 |is-able |it......|
|00002280| 0d 09 09 69 66 20 28 67 | 4c 61 6e 64 73 63 61 70 |...if (g|Landscap|
|00002290| 65 4f 70 49 6d 70 6c 29 | 20 0d 20 20 20 09 09 20 |eOpImpl)| . .. |
|000022a0| 20 45 6e 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 | EnableI|tem(menu|
|000022b0| 2c 20 69 43 68 65 63 6b | 46 6f 72 4c 61 6e 64 73 |, iCheck|ForLands|
|000022c0| 63 61 70 65 29 3b 0d 09 | 20 20 20 20 65 6c 73 65 |cape);..| else|
|000022d0| 0d 09 09 20 20 7b 0d 09 | 09 20 20 09 43 68 65 63 |... {..|. .Chec|
|000022e0| 6b 49 74 65 6d 28 47 65 | 74 4d 48 61 6e 64 6c 65 |kItem(Ge|tMHandle|
|000022f0| 28 6d 50 72 47 65 6e 65 | 72 61 6c 29 2c 20 69 43 |(mPrGene|ral), iC|
|00002300| 68 65 63 6b 46 6f 72 4c | 61 6e 64 73 63 61 70 65 |heckForL|andscape|
|00002310| 2c 20 66 61 6c 73 65 29 | 3b 0d 09 09 20 20 20 20 |, false)|;... |
|00002320| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |DisableI|tem(menu|
|00002330| 2c 20 69 43 68 65 63 6b | 46 6f 72 4c 61 6e 64 73 |, iCheck|ForLands|
|00002340| 63 61 70 65 29 3b 0d 09 | 09 20 20 7d 0d 0d 09 09 |cape);..|. }....|
|00002350| 69 66 20 28 67 53 65 74 | 52 73 6c 4f 70 49 6d 70 |if (gSet|RslOpImp|
|00002360| 6c 29 20 0d 20 20 20 09 | 09 20 20 45 6e 61 62 6c |l) . .|. Enabl|
|00002370| 65 49 74 65 6d 28 6d 65 | 6e 75 2c 20 69 54 75 72 |eItem(me|nu, iTur|
|00002380| 6e 48 69 67 68 52 65 73 | 4f 46 46 29 3b 0d 09 20 |nHighRes|OFF);.. |
|00002390| 20 20 20 65 6c 73 65 0d | 09 09 20 20 7b 0d 09 09 | else.|.. {...|
|000023a0| 20 20 09 43 68 65 63 6b | 49 74 65 6d 28 47 65 74 | .Check|Item(Get|
|000023b0| 4d 48 61 6e 64 6c 65 28 | 6d 50 72 47 65 6e 65 72 |MHandle(|mPrGener|
|000023c0| 61 6c 29 2c 20 69 54 75 | 72 6e 48 69 67 68 52 65 |al), iTu|rnHighRe|
|000023d0| 73 4f 46 46 2c 20 66 61 | 6c 73 65 29 3b 0d 09 09 |sOFF, fa|lse);...|
|000023e0| 20 20 20 20 44 69 73 61 | 62 6c 65 49 74 65 6d 28 | Disa|bleItem(|
|000023f0| 6d 65 6e 75 2c 20 69 54 | 75 72 6e 48 69 67 68 52 |menu, iT|urnHighR|
|00002400| 65 73 4f 46 46 29 3b 0d | 09 09 20 20 7d 0d 0d 09 |esOFF);.|.. }...|
|00002410| 09 69 66 20 28 67 44 72 | 61 66 74 42 69 74 73 4f |.if (gDr|aftBitsO|
|00002420| 70 49 6d 70 6c 29 20 0d | 20 20 20 09 09 20 20 45 |pImpl) .| .. E|
|00002430| 6e 61 62 6c 65 49 74 65 | 6d 28 6d 65 6e 75 2c 20 |nableIte|m(menu, |
|00002440| 69 55 73 65 44 72 61 66 | 74 42 69 74 73 29 3b 0d |iUseDraf|tBits);.|
|00002450| 09 20 20 20 20 65 6c 73 | 65 20 0d 09 09 20 20 7b |. els|e ... {|
|00002460| 0d 09 09 20 20 09 43 68 | 65 63 6b 49 74 65 6d 28 |... .Ch|eckItem(|
|00002470| 47 65 74 4d 48 61 6e 64 | 6c 65 28 6d 50 72 47 65 |GetMHand|le(mPrGe|
|00002480| 6e 65 72 61 6c 29 2c 20 | 69 55 73 65 44 72 61 66 |neral), |iUseDraf|
|00002490| 74 42 69 74 73 2c 20 66 | 61 6c 73 65 29 3b 0d 09 |tBits, f|alse);..|
|000024a0| 09 20 20 20 20 44 69 73 | 61 62 6c 65 49 74 65 6d |. Dis|ableItem|
|000024b0| 28 6d 65 6e 75 2c 20 69 | 55 73 65 44 72 61 66 74 |(menu, i|UseDraft|
|000024c0| 42 69 74 73 29 3b 0d 09 | 09 20 20 7d 0d 09 7d 20 |Bits);..|. }..} |
|000024d0| 0d 09 65 6c 73 65 20 7b | 0d 09 09 43 68 65 63 6b |..else {|...Check|
|000024e0| 49 74 65 6d 28 47 65 74 | 4d 48 61 6e 64 6c 65 28 |Item(Get|MHandle(|
|000024f0| 6d 50 72 47 65 6e 65 72 | 61 6c 29 2c 20 69 54 75 |mPrGener|al), iTu|
|00002500| 72 6e 48 69 67 68 52 65 | 73 4f 46 46 2c 20 66 61 |rnHighRe|sOFF, fa|
|00002510| 6c 73 65 29 3b 0d 09 09 | 44 69 73 61 62 6c 65 49 |lse);...|DisableI|
|00002520| 74 65 6d 28 6d 65 6e 75 | 2c 20 69 54 75 72 6e 48 |tem(menu|, iTurnH|
|00002530| 69 67 68 52 65 73 4f 46 | 46 29 3b 0d 09 09 0d 09 |ighResOF|F);.....|
|00002540| 09 43 68 65 63 6b 49 74 | 65 6d 28 47 65 74 4d 48 |.CheckIt|em(GetMH|
|00002550| 61 6e 64 6c 65 28 6d 50 | 72 47 65 6e 65 72 61 6c |andle(mP|rGeneral|
|00002560| 29 2c 20 69 55 73 65 44 | 72 61 66 74 42 69 74 73 |), iUseD|raftBits|
|00002570| 2c 20 66 61 6c 73 65 29 | 3b 0d 09 09 44 69 73 61 |, false)|;...Disa|
|00002580| 62 6c 65 49 74 65 6d 28 | 6d 65 6e 75 2c 20 69 55 |bleItem(|menu, iU|
|00002590| 73 65 44 72 61 66 74 42 | 69 74 73 29 3b 0d 09 09 |seDraftB|its);...|
|000025a0| 0d 09 09 43 68 65 63 6b | 49 74 65 6d 28 47 65 74 |...Check|Item(Get|
|000025b0| 4d 48 61 6e 64 6c 65 28 | 6d 50 72 47 65 6e 65 72 |MHandle(|mPrGener|
|000025c0| 61 6c 29 2c 20 69 43 68 | 65 63 6b 46 6f 72 4c 61 |al), iCh|eckForLa|
|000025d0| 6e 64 73 63 61 70 65 2c | 20 66 61 6c 73 65 29 3b |ndscape,| false);|
|000025e0| 0d 09 09 44 69 73 61 62 | 6c 65 49 74 65 6d 28 6d |...Disab|leItem(m|
|000025f0| 65 6e 75 2c 20 69 43 68 | 65 63 6b 46 6f 72 4c 61 |enu, iCh|eckForLa|
|00002600| 6e 64 73 63 61 70 65 29 | 3b 0d 09 7d 0d 0d 7d 20 |ndscape)|;..}..} |
|00002610| 2f 2a 41 64 6a 75 73 74 | 4d 65 6e 75 73 2a 2f 0d |/*Adjust|Menus*/.|
|00002620| 0d 0d 2f 2a 09 54 68 69 | 73 20 69 73 20 63 61 6c |../*.Thi|s is cal|
|00002630| 6c 65 64 20 77 68 65 6e | 20 61 6e 20 69 74 65 6d |led when| an item|
|00002640| 20 69 73 20 63 68 6f 73 | 65 6e 20 66 72 6f 6d 20 | is chos|en from |
|00002650| 74 68 65 20 6d 65 6e 75 | 20 62 61 72 20 28 61 66 |the menu| bar (af|
|00002660| 74 65 72 20 63 61 6c 6c | 69 6e 67 0d 09 4d 65 6e |ter call|ing..Men|
|00002670| 75 53 65 6c 65 63 74 20 | 6f 72 20 4d 65 6e 75 4b |uSelect |or MenuK|
|00002680| 65 79 29 2e 20 49 74 20 | 70 65 72 66 6f 72 6d 73 |ey). It |performs|
|00002690| 20 74 68 65 20 72 69 67 | 68 74 20 6f 70 65 72 61 | the rig|ht opera|
|000026a0| 74 69 6f 6e 20 66 6f 72 | 20 65 61 63 68 20 63 6f |tion for| each co|
|000026b0| 6d 6d 61 6e 64 2e 0d 09 | 49 74 20 69 73 20 67 6f |mmand...|It is go|
|000026c0| 6f 64 20 74 6f 20 68 61 | 76 65 20 62 6f 74 68 20 |od to ha|ve both |
|000026d0| 74 68 65 20 72 65 73 75 | 6c 74 20 6f 66 20 4d 65 |the resu|lt of Me|
|000026e0| 6e 75 53 65 6c 65 63 74 | 20 61 6e 64 20 4d 65 6e |nuSelect| and Men|
|000026f0| 75 4b 65 79 20 67 6f 20 | 74 6f 0d 09 6f 6e 65 20 |uKey go |to..one |
|00002700| 72 6f 75 74 69 6e 65 20 | 6c 69 6b 65 20 74 68 69 |routine |like thi|
|00002710| 73 20 74 6f 20 6b 65 65 | 70 20 65 76 65 72 79 74 |s to kee|p everyt|
|00002720| 68 69 6e 67 20 6f 72 67 | 61 6e 69 7a 65 64 2e 20 |hing org|anized. |
|00002730| 2a 2f 0d 0d 23 70 72 61 | 67 6d 61 20 73 65 67 6d |*/..#pra|gma segm|
|00002740| 65 6e 74 20 4d 61 69 6e | 0d 76 6f 69 64 20 44 6f |ent Main|.void Do|
|00002750| 4d 65 6e 75 43 6f 6d 6d | 61 6e 64 28 6d 65 6e 75 |MenuComm|and(menu|
|00002760| 52 65 73 75 6c 74 29 0d | 09 6c 6f 6e 67 09 09 6d |Result).|.long..m|
|00002770| 65 6e 75 52 65 73 75 6c | 74 3b 0d 7b 0d 09 73 68 |enuResul|t;.{..sh|
|00002780| 6f 72 74 09 09 6d 65 6e | 75 49 44 3b 09 09 09 09 |ort..men|uID;....|
|00002790| 2f 2a 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |/* the r|esource |
|000027a0| 49 44 20 6f 66 20 74 68 | 65 20 73 65 6c 65 63 74 |ID of th|e select|
|000027b0| 65 64 20 6d 65 6e 75 20 | 2a 2f 0d 09 73 68 6f 72 |ed menu |*/..shor|
|000027c0| 74 09 09 6d 65 6e 75 49 | 74 65 6d 3b 09 09 09 2f |t..menuI|tem;.../|
|000027d0| 2a 20 74 68 65 20 69 74 | 65 6d 20 6e 75 6d 62 65 |* the it|em numbe|
|000027e0| 72 20 6f 66 20 74 68 65 | 20 73 65 6c 65 63 74 65 |r of the| selecte|
|000027f0| 64 20 6d 65 6e 75 20 2a | 2f 0d 09 73 68 6f 72 74 |d menu *|/..short|
|00002800| 09 09 69 74 65 6d 48 69 | 74 2c 0d 09 09 09 09 70 |..itemHi|t,.....p|
|00002810| 72 69 6e 74 45 72 72 20 | 3d 20 30 3b 0d 09 53 74 |rintErr |= 0;..St|
|00002820| 72 32 35 35 09 09 64 61 | 4e 61 6d 65 3b 0d 09 73 |r255..da|Name;..s|
|00002830| 68 6f 72 74 09 09 64 61 | 52 65 66 4e 75 6d 3b 0d |hort..da|RefNum;.|
|00002840| 09 42 6f 6f 6c 65 61 6e | 09 09 68 61 6e 64 6c 65 |.Boolean|..handle|
|00002850| 64 42 79 44 41 3b 0d 09 | 0d 09 6d 65 6e 75 49 44 |dByDA;..|..menuID|
|00002860| 20 3d 20 48 69 57 6f 72 | 64 28 6d 65 6e 75 52 65 | = HiWor|d(menuRe|
|00002870| 73 75 6c 74 29 3b 09 2f | 2a 20 75 73 65 20 6d 61 |sult);./|* use ma|
|00002880| 63 72 6f 73 20 66 6f 72 | 20 65 66 66 69 63 69 65 |cros for| efficie|
|00002890| 6e 63 79 20 74 6f 2e 2e | 2e 20 2a 2f 0d 09 6d 65 |ncy to..|. */..me|
|000028a0| 6e 75 49 74 65 6d 20 3d | 20 4c 6f 57 6f 72 64 28 |nuItem =| LoWord(|
|000028b0| 6d 65 6e 75 52 65 73 75 | 6c 74 29 3b 09 2f 2a 20 |menuResu|lt);./* |
|000028c0| 67 65 74 20 6d 65 6e 75 | 20 69 74 65 6d 20 6e 75 |get menu| item nu|
|000028d0| 6d 62 65 72 20 61 6e 64 | 20 6d 65 6e 75 20 6e 75 |mber and| menu nu|
|000028e0| 6d 62 65 72 20 2a 2f 0d | 09 73 77 69 74 63 68 20 |mber */.|.switch |
|000028f0| 28 20 6d 65 6e 75 49 44 | 20 29 20 7b 0d 09 09 63 |( menuID| ) {...c|
|00002900| 61 73 65 20 6d 41 70 70 | 6c 65 3a 0d 09 09 09 73 |ase mApp|le:....s|
|00002910| 77 69 74 63 68 20 28 20 | 6d 65 6e 75 49 74 65 6d |witch ( |menuItem|
|00002920| 20 29 20 7b 0d 09 09 09 | 09 63 61 73 65 20 69 41 | ) {....|.case iA|
|00002930| 62 6f 75 74 3a 09 09 2f | 2a 20 62 72 69 6e 67 20 |bout:../|* bring |
|00002940| 75 70 20 61 6c 65 72 74 | 20 66 6f 72 20 41 62 6f |up alert| for Abo|
|00002950| 75 74 20 2a 2f 0d 09 09 | 09 09 09 69 74 65 6d 48 |ut */...|...itemH|
|00002960| 69 74 20 3d 20 41 6c 65 | 72 74 28 72 41 62 6f 75 |it = Ale|rt(rAbou|
|00002970| 74 41 6c 65 72 74 2c 20 | 6e 69 6c 29 3b 0d 09 09 |tAlert, |nil);...|
|00002980| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 64 65 |...break|;.....de|
|00002990| 66 61 75 6c 74 3a 09 09 | 09 2f 2a 20 61 6c 6c 20 |fault:..|./* all |
|000029a0| 6e 6f 6e 2d 41 62 6f 75 | 74 20 69 74 65 6d 73 20 |non-Abou|t items |
|000029b0| 69 6e 20 74 68 69 73 20 | 6d 65 6e 75 20 61 72 65 |in this |menu are|
|000029c0| 20 44 41 73 20 2a 2f 0d | 09 09 09 09 09 2f 2a 20 | DAs */.|...../* |
|000029d0| 74 79 70 65 20 53 74 72 | 32 35 35 20 69 73 20 61 |type Str|255 is a|
|000029e0| 6e 20 61 72 72 61 79 20 | 69 6e 20 4d 50 57 20 33 |n array |in MPW 3|
|000029f0| 20 2a 2f 0d 09 09 09 09 | 09 47 65 74 49 74 65 6d | */.....|.GetItem|
|00002a00| 28 47 65 74 4d 48 61 6e | 64 6c 65 28 6d 41 70 70 |(GetMHan|dle(mApp|
|00002a10| 6c 65 29 2c 20 6d 65 6e | 75 49 74 65 6d 2c 20 64 |le), men|uItem, d|
|00002a20| 61 4e 61 6d 65 29 3b 0d | 09 09 09 09 09 64 61 52 |aName);.|.....daR|
|00002a30| 65 66 4e 75 6d 20 3d 20 | 4f 70 65 6e 44 65 73 6b |efNum = |OpenDesk|
|00002a40| 41 63 63 28 64 61 4e 61 | 6d 65 29 3b 0d 09 09 09 |Acc(daNa|me);....|
|00002a50| 09 09 62 72 65 61 6b 3b | 0d 09 09 09 7d 0d 09 09 |..break;|....}...|
|00002a60| 09 62 72 65 61 6b 3b 0d | 09 09 63 61 73 65 20 6d |.break;.|..case m|
|00002a70| 46 69 6c 65 3a 0d 09 09 | 09 73 77 69 74 63 68 20 |File:...|.switch |
|00002a80| 28 20 6d 65 6e 75 49 74 | 65 6d 20 29 20 7b 0d 09 |( menuIt|em ) {..|
|00002a90| 09 09 09 63 61 73 65 20 | 69 4e 65 77 3a 0d 09 09 |...case |iNew:...|
|00002aa0| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 63 61 |...break|;.....ca|
|00002ab0| 73 65 20 69 4f 70 65 6e | 3a 0d 09 09 09 09 09 62 |se iOpen|:......b|
|00002ac0| 72 65 61 6b 3b 0d 09 09 | 09 09 63 61 73 65 20 69 |reak;...|..case i|
|00002ad0| 53 61 76 65 3a 0d 09 09 | 09 09 09 62 72 65 61 6b |Save:...|...break|
|00002ae0| 3b 0d 09 09 09 09 63 61 | 73 65 20 69 43 6c 6f 73 |;.....ca|se iClos|
|00002af0| 65 3a 0d 09 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 |e:......|break;..|
|00002b00| 09 09 09 63 61 73 65 20 | 69 50 61 67 65 53 65 74 |...case |iPageSet|
|00002b10| 75 70 3a 0d 09 09 09 09 | 09 50 72 65 73 65 6e 74 |up:.....|.Present|
|00002b20| 53 74 79 6c 65 44 69 61 | 6c 6f 67 28 29 3b 0d 09 |StyleDia|log();..|
|00002b30| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 63 |....brea|k;.....c|
|00002b40| 61 73 65 20 69 50 72 69 | 6e 74 3a 0d 09 09 09 09 |ase iPri|nt:.....|
|00002b50| 09 50 72 69 6e 74 54 68 | 69 73 28 29 3b 0d 09 09 |.PrintTh|is();...|
|00002b60| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 63 61 |...break|;.....ca|
|00002b70| 73 65 20 69 51 75 69 74 | 3a 0d 09 09 09 09 09 54 |se iQuit|:......T|
|00002b80| 65 72 6d 69 6e 61 74 65 | 28 29 3b 0d 09 09 09 09 |erminate|();.....|
|00002b90| 09 62 72 65 61 6b 3b 0d | 09 09 09 7d 0d 09 09 09 |.break;.|...}....|
|00002ba0| 62 72 65 61 6b 3b 0d 09 | 09 63 61 73 65 20 6d 45 |break;..|.case mE|
|00002bb0| 64 69 74 3a 09 09 09 09 | 09 2f 2a 20 63 61 6c 6c |dit:....|./* call|
|00002bc0| 20 53 79 73 74 65 6d 45 | 64 69 74 20 66 6f 72 20 | SystemE|dit for |
|00002bd0| 44 41 20 65 64 69 74 69 | 6e 67 20 26 20 4d 75 6c |DA editi|ng & Mul|
|00002be0| 74 69 46 69 6e 64 65 72 | 20 2a 2f 0d 09 09 09 68 |tiFinder| */....h|
|00002bf0| 61 6e 64 6c 65 64 42 79 | 44 41 20 3d 20 53 79 73 |andledBy|DA = Sys|
|00002c00| 74 65 6d 45 64 69 74 28 | 6d 65 6e 75 49 74 65 6d |temEdit(|menuItem|
|00002c10| 2d 31 29 3b 09 2f 2a 20 | 73 69 6e 63 65 20 77 65 |-1);./* |since we|
|00002c20| 20 64 6f 6e d5 74 20 64 | 6f 20 61 6e 79 20 45 64 | don.t d|o any Ed|
|00002c30| 69 74 69 6e 67 20 2a 2f | 0d 09 09 09 62 72 65 61 |iting */|....brea|
|00002c40| 6b 3b 0d 09 09 63 61 73 | 65 20 6d 50 72 47 65 6e |k;...cas|e mPrGen|
|00002c50| 65 72 61 6c 3a 0d 09 09 | 09 73 77 69 74 63 68 20 |eral:...|.switch |
|00002c60| 28 20 6d 65 6e 75 49 74 | 65 6d 20 29 20 7b 0d 09 |( menuIt|em ) {..|
|00002c70| 09 09 09 63 61 73 65 20 | 69 54 75 72 6e 48 69 67 |...case |iTurnHig|
|00002c80| 68 52 65 73 4f 46 46 3a | 0d 09 09 09 09 09 20 7b |hResOFF:|...... {|
|00002c90| 0d 09 09 09 09 09 20 20 | 20 50 72 4f 70 65 6e 20 |...... | PrOpen |
|00002ca0| 28 29 3b 0d 09 09 09 09 | 09 20 20 20 20 69 66 20 |();.....|. if |
|00002cb0| 28 50 72 45 72 72 6f 72 | 20 28 29 20 3d 3d 20 6e |(PrError| () == n|
|00002cc0| 6f 45 72 72 29 0d 09 09 | 09 09 09 09 20 7b 0d 09 |oErr)...|.... {..|
|00002cd0| 09 09 09 09 20 20 20 20 | 20 20 69 66 20 28 21 67 |.... | if (!g|
|00002ce0| 48 69 67 68 52 65 73 6f | 6c 75 74 69 6f 6e 4f 4e |HighReso|lutionON|
|00002cf0| 29 0d 09 09 09 09 09 09 | 20 20 20 20 7b 0d 09 09 |).......| {...|
|00002d00| 09 09 09 09 20 09 20 20 | 67 48 69 67 68 52 65 73 |.... . |gHighRes|
|00002d10| 6f 6c 75 74 69 6f 6e 4f | 4e 20 3d 20 74 72 75 65 |olutionO|N = true|
|00002d20| 3b 0d 09 09 09 09 09 09 | 09 20 20 43 68 65 63 6b |;.......|. Check|
|00002d30| 49 74 65 6d 28 47 65 74 | 4d 48 61 6e 64 6c 65 28 |Item(Get|MHandle(|
|00002d40| 6d 50 72 47 65 6e 65 72 | 61 6c 29 2c 20 69 54 75 |mPrGener|al), iTu|
|00002d50| 72 6e 48 69 67 68 52 65 | 73 4f 46 46 2c 20 74 72 |rnHighRe|sOFF, tr|
|00002d60| 75 65 29 3b 0d 09 09 09 | 09 09 09 09 20 0d 09 09 |ue);....|.... ...|
|00002d70| 09 09 09 09 09 20 20 64 | 6f 53 65 74 52 73 6c 28 |..... d|oSetRsl(|
|00002d80| 29 3b 0d 09 09 09 09 09 | 09 09 7d 0d 09 09 09 09 |);......|..}.....|
|00002d90| 09 09 20 20 20 65 6c 73 | 65 0d 09 09 09 09 09 09 |.. els|e.......|
|00002da0| 20 20 20 20 20 7b 0d 09 | 09 09 09 09 09 20 09 20 | {..|..... . |
|00002db0| 20 67 48 69 67 68 52 65 | 73 6f 6c 75 74 69 6f 6e | gHighRe|solution|
|00002dc0| 4f 4e 20 3d 20 66 61 6c | 73 65 3b 0d 09 09 09 09 |ON = fal|se;.....|
|00002dd0| 09 09 09 20 20 43 68 65 | 63 6b 49 74 65 6d 28 47 |... Che|ckItem(G|
|00002de0| 65 74 4d 48 61 6e 64 6c | 65 28 6d 50 72 47 65 6e |etMHandl|e(mPrGen|
|00002df0| 65 72 61 6c 29 2c 20 69 | 54 75 72 6e 48 69 67 68 |eral), i|TurnHigh|
|00002e00| 52 65 73 4f 46 46 2c 20 | 66 61 6c 73 65 29 3b 0d |ResOFF, |false);.|
|00002e10| 09 09 09 09 09 09 09 20 | 0d 09 09 09 09 09 09 09 |....... |........|
|00002e20| 20 20 72 65 73 65 74 53 | 65 74 52 73 6c 28 29 3b | resetS|etRsl();|
|00002e30| 0d 09 09 09 09 09 09 09 | 20 7d 0d 09 09 09 09 09 |........| }......|
|00002e40| 09 20 7d 0d 09 09 09 09 | 09 09 20 65 6c 73 65 20 |. }.....|.. else |
|00002e50| 70 72 69 6e 74 45 72 72 | 20 3d 20 50 72 45 72 72 |printErr| = PrErr|
|00002e60| 6f 72 20 28 29 3b 0d 09 | 09 09 09 09 09 20 0d 09 |or ();..|..... ..|
|00002e70| 09 09 09 09 20 20 20 50 | 72 43 6c 6f 73 65 20 28 |.... P|rClose (|
|00002e80| 29 3b 0d 09 09 09 09 09 | 09 0d 09 09 09 09 09 09 |);......|........|
|00002e90| 69 66 20 28 70 72 69 6e | 74 45 72 72 20 21 3d 20 |if (prin|tErr != |
|00002ea0| 6e 6f 45 72 72 29 20 20 | 41 6c 65 72 74 55 73 65 |noErr) |AlertUse|
|00002eb0| 72 20 28 29 3b 0d 09 09 | 09 09 09 20 20 7d 0d 09 |r ();...|... }..|
|00002ec0| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 63 |....brea|k;.....c|
|00002ed0| 61 73 65 20 69 55 73 65 | 44 72 61 66 74 42 69 74 |ase iUse|DraftBit|
|00002ee0| 73 3a 0d 09 09 09 09 20 | 20 20 20 20 7b 0d 09 09 |s:..... | {...|
|00002ef0| 09 09 09 20 20 20 50 72 | 4f 70 65 6e 20 28 29 3b |... Pr|Open ();|
|00002f00| 0d 09 09 09 09 09 20 20 | 20 20 69 66 20 28 50 72 |...... | if (Pr|
|00002f10| 45 72 72 6f 72 20 28 29 | 20 3d 3d 20 6e 6f 45 72 |Error ()| == noEr|
|00002f20| 72 29 0d 09 09 09 09 09 | 09 20 7b 0d 09 09 09 09 |r)......|. {.....|
|00002f30| 09 20 20 20 20 20 20 69 | 66 20 28 21 67 55 73 65 |. i|f (!gUse|
|00002f40| 44 72 61 66 74 42 69 74 | 73 29 0d 09 09 09 09 09 |DraftBit|s)......|
|00002f50| 09 20 20 20 20 7b 0d 09 | 09 09 09 09 09 20 09 20 |. {..|..... . |
|00002f60| 20 67 55 73 65 44 72 61 | 66 74 42 69 74 73 20 3d | gUseDra|ftBits =|
|00002f70| 20 74 72 75 65 3b 0d 09 | 09 09 09 09 09 09 20 20 | true;..|...... |
|00002f80| 43 68 65 63 6b 49 74 65 | 6d 28 47 65 74 4d 48 61 |CheckIte|m(GetMHa|
|00002f90| 6e 64 6c 65 28 6d 50 72 | 47 65 6e 65 72 61 6c 29 |ndle(mPr|General)|
|00002fa0| 2c 20 69 55 73 65 44 72 | 61 66 74 42 69 74 73 2c |, iUseDr|aftBits,|
|00002fb0| 20 74 72 75 65 29 3b 0d | 09 09 09 09 09 09 09 20 | true);.|....... |
|00002fc0| 20 0d 09 09 09 09 09 09 | 09 20 20 64 6f 44 72 61 | .......|. doDra|
|00002fd0| 66 74 42 69 74 73 20 28 | 29 3b 0d 09 09 09 09 09 |ftBits (|);......|
|00002fe0| 09 09 20 7d 0d 09 09 09 | 09 09 09 20 20 65 6c 73 |.. }....|... els|
|00002ff0| 65 0d 09 09 09 09 09 09 | 20 20 20 20 7b 0d 09 09 |e.......| {...|
|00003000| 09 09 09 09 20 09 20 20 | 67 55 73 65 44 72 61 66 |.... . |gUseDraf|
|00003010| 74 42 69 74 73 20 3d 20 | 66 61 6c 73 65 3b 0d 09 |tBits = |false;..|
|00003020| 09 09 09 09 09 09 20 20 | 43 68 65 63 6b 49 74 65 |...... |CheckIte|
|00003030| 6d 28 47 65 74 4d 48 61 | 6e 64 6c 65 28 6d 50 72 |m(GetMHa|ndle(mPr|
|00003040| 47 65 6e 65 72 61 6c 29 | 2c 20 69 55 73 65 44 72 |General)|, iUseDr|
|00003050| 61 66 74 42 69 74 73 2c | 20 66 61 6c 73 65 29 3b |aftBits,| false);|
|00003060| 0d 09 09 09 09 09 09 09 | 20 20 0d 09 09 09 09 09 |........| ......|
|00003070| 09 09 20 20 64 6f 4e 4f | 44 72 61 66 74 42 69 74 |.. doNO|DraftBit|
|00003080| 73 20 28 29 3b 0d 09 09 | 09 09 09 09 09 20 7d 0d |s ();...|..... }.|
|00003090| 09 09 09 09 09 09 20 0d | 09 09 09 09 09 09 20 7d |...... .|...... }|
|000030a0| 0d 09 09 09 09 09 09 20 | 65 6c 73 65 20 70 72 69 |....... |else pri|
|000030b0| 6e 74 45 72 72 20 3d 20 | 50 72 45 72 72 6f 72 20 |ntErr = |PrError |
|000030c0| 28 29 3b 0d 09 09 09 09 | 09 09 20 0d 09 09 09 09 |();.....|.. .....|
|000030d0| 09 20 20 20 50 72 43 6c | 6f 73 65 20 28 29 3b 0d |. PrCl|ose ();.|
|000030e0| 09 09 09 09 09 09 0d 09 | 09 09 09 09 20 20 20 69 |........|.... i|
|000030f0| 66 20 28 70 72 69 6e 74 | 45 72 72 20 21 3d 20 6e |f (print|Err != n|
|00003100| 6f 45 72 72 29 20 20 41 | 6c 65 72 74 55 73 65 72 |oErr) A|lertUser|
|00003110| 20 28 29 3b 0d 09 09 09 | 09 09 20 7d 0d 09 09 09 | ();....|.. }....|
|00003120| 09 09 62 72 65 61 6b 3b | 0d 09 09 09 09 63 61 73 |..break;|.....cas|
|00003130| 65 20 69 43 68 65 63 6b | 46 6f 72 4c 61 6e 64 73 |e iCheck|ForLands|
|00003140| 63 61 70 65 3a 0d 09 09 | 09 09 20 20 20 20 20 7b |cape:...|.. {|
|00003150| 0d 09 09 09 09 09 20 20 | 20 20 69 66 20 28 21 67 |...... | if (!g|
|00003160| 43 68 65 63 6b 46 6f 72 | 4c 61 6e 64 73 63 61 70 |CheckFor|Landscap|
|00003170| 65 29 0d 09 09 09 09 09 | 09 20 20 7b 0d 09 09 09 |e)......|. {....|
|00003180| 09 09 09 20 09 20 20 67 | 43 68 65 63 6b 46 6f 72 |... . g|CheckFor|
|00003190| 4c 61 6e 64 73 63 61 70 | 65 20 3d 20 74 72 75 65 |Landscap|e = true|
|000031a0| 3b 0d 09 09 09 09 09 09 | 09 20 20 43 68 65 63 6b |;.......|. Check|
|000031b0| 49 74 65 6d 28 47 65 74 | 4d 48 61 6e 64 6c 65 28 |Item(Get|MHandle(|
|000031c0| 6d 50 72 47 65 6e 65 72 | 61 6c 29 2c 20 69 43 68 |mPrGener|al), iCh|
|000031d0| 65 63 6b 46 6f 72 4c 61 | 6e 64 73 63 61 70 65 2c |eckForLa|ndscape,|
|000031e0| 20 74 72 75 65 29 3b 0d | 09 09 09 09 09 09 20 20 | true);.|...... |
|000031f0| 7d 0d 09 09 09 09 09 09 | 20 65 6c 73 65 0d 09 09 |}.......| else...|
|00003200| 09 09 09 09 20 20 20 20 | 7b 0d 09 09 09 09 09 09 |.... |{.......|
|00003210| 20 09 20 20 67 43 68 65 | 63 6b 46 6f 72 4c 61 6e | . gChe|ckForLan|
|00003220| 64 73 63 61 70 65 20 3d | 20 66 61 6c 73 65 3b 0d |dscape =| false;.|
|00003230| 09 09 09 09 09 09 09 20 | 20 43 68 65 63 6b 49 74 |....... | CheckIt|
|00003240| 65 6d 28 47 65 74 4d 48 | 61 6e 64 6c 65 28 6d 50 |em(GetMH|andle(mP|
|00003250| 72 47 65 6e 65 72 61 6c | 29 2c 20 69 43 68 65 63 |rGeneral|), iChec|
|00003260| 6b 46 6f 72 4c 61 6e 64 | 73 63 61 70 65 2c 20 66 |kForLand|scape, f|
|00003270| 61 6c 73 65 29 3b 0d 09 | 09 09 09 09 09 09 7d 0d |alse);..|......}.|
|00003280| 09 09 09 09 09 20 7d 0d | 09 09 09 09 09 62 72 65 |..... }.|.....bre|
|00003290| 61 6b 3b 0d 09 09 09 7d | 0d 09 09 09 62 72 65 61 |ak;....}|....brea|
|000032a0| 6b 3b 0d 09 7d 0d 09 48 | 69 6c 69 74 65 4d 65 6e |k;..}..H|iliteMen|
|000032b0| 75 28 30 29 3b 09 09 09 | 09 09 2f 2a 20 75 6e 68 |u(0);...|../* unh|
|000032c0| 69 67 68 6c 69 67 68 74 | 20 77 68 61 74 20 4d 65 |ighlight| what Me|
|000032d0| 6e 75 53 65 6c 65 63 74 | 20 28 6f 72 20 4d 65 6e |nuSelect| (or Men|
|000032e0| 75 4b 65 79 29 20 68 69 | 6c 69 74 65 64 20 2a 2f |uKey) hi|lited */|
|000032f0| 0d 7d 20 2f 2a 44 6f 4d | 65 6e 75 43 6f 6d 6d 61 |.} /*DoM|enuComma|
|00003300| 6e 64 2a 2f 0d 0d 0d 2f | 2a 20 43 6c 65 61 6e 20 |nd*/.../|* Clean |
|00003310| 75 70 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |up the a|pplicati|
|00003320| 6f 6e 20 61 6e 64 20 65 | 78 69 74 2e 20 57 65 20 |on and e|xit. We |
|00003330| 63 6c 6f 73 65 20 61 6c | 6c 20 6f 66 20 74 68 65 |close al|l of the|
|00003340| 20 77 69 6e 64 6f 77 73 | 20 73 6f 20 74 68 61 74 | windows| so that|
|00003350| 0d 20 74 68 65 79 20 63 | 61 6e 20 75 70 64 61 74 |. they c|an updat|
|00003360| 65 20 74 68 65 69 72 20 | 64 6f 63 75 6d 65 6e 74 |e their |document|
|00003370| 73 2c 20 69 66 20 61 6e | 79 2e 20 2a 2f 0d 20 0d |s, if an|y. */. .|
|00003380| 23 70 72 61 67 6d 61 20 | 73 65 67 6d 65 6e 74 20 |#pragma |segment |
|00003390| 4d 61 69 6e 0d 76 6f 69 | 64 20 54 65 72 6d 69 6e |Main.voi|d Termin|
|000033a0| 61 74 65 28 29 0d 7b 0d | 09 69 66 20 28 67 50 72 |ate().{.|.if (gPr|
|000033b0| 52 65 63 48 64 6c 20 21 | 3d 20 6e 69 6c 29 20 20 |RecHdl !|= nil) |
|000033c0| 20 20 0d 09 20 20 44 69 | 73 70 6f 73 48 61 6e 64 | .. Di|sposHand|
|000033d0| 6c 65 20 28 28 48 61 6e | 64 6c 65 29 20 67 50 72 |le ((Han|dle) gPr|
|000033e0| 52 65 63 48 64 6c 29 3b | 20 20 20 20 20 2f 2f 20 |RecHdl);| // |
|000033f0| 44 69 73 70 6f 73 65 20 | 6f 66 20 74 68 65 20 70 |Dispose |of the p|
|00003400| 72 69 6e 74 20 72 65 63 | 6f 72 64 0d 09 0d 09 45 |rint rec|ord....E|
|00003410| 78 69 74 54 6f 53 68 65 | 6c 6c 28 29 3b 0d 09 0d |xitToShe|ll();...|
|00003420| 7d 20 2f 2a 54 65 72 6d | 69 6e 61 74 65 2a 2f 0d |} /*Term|inate*/.|
|00003430| 0d 0d 0d 2f 2a 09 31 2e | 30 31 20 2d 20 54 68 65 |.../*.1.|01 - The|
|00003440| 20 63 6f 64 65 20 74 68 | 61 74 20 75 73 65 64 20 | code th|at used |
|00003450| 74 6f 20 62 65 20 70 61 | 72 74 20 6f 66 20 46 6f |to be pa|rt of Fo|
|00003460| 72 63 65 45 6e 76 69 72 | 6f 6e 73 20 68 61 73 20 |rceEnvir|ons has |
|00003470| 62 65 65 6e 20 6d 6f 76 | 65 64 20 69 6e 74 6f 0d |been mov|ed into.|
|00003480| 09 74 68 69 73 20 6d 6f | 64 75 6c 65 2e 20 49 66 |.this mo|dule. If|
|00003490| 20 61 6e 20 65 72 72 6f | 72 20 69 73 20 64 65 74 | an erro|r is det|
|000034a0| 65 63 74 65 64 2c 20 69 | 6e 73 74 65 61 64 20 6f |ected, i|nstead o|
|000034b0| 66 20 6d 65 72 65 6c 79 | 20 64 6f 69 6e 67 20 61 |f merely| doing a|
|000034c0| 6e 20 45 78 69 74 54 6f | 53 68 65 6c 6c 2c 0d 09 |n ExitTo|Shell,..|
|000034d0| 77 68 69 63 68 20 6c 65 | 61 76 65 73 20 74 68 65 |which le|aves the|
|000034e0| 20 75 73 65 72 20 77 69 | 74 68 6f 75 74 20 6d 75 | user wi|thout mu|
|000034f0| 63 68 20 74 6f 20 67 6f | 20 6f 6e 2c 20 77 65 20 |ch to go| on, we |
|00003500| 63 61 6c 6c 20 41 6c 65 | 72 74 55 73 65 72 2c 20 |call Ale|rtUser, |
|00003510| 77 68 69 63 68 20 70 75 | 74 73 0d 09 75 70 20 61 |which pu|ts..up a|
|00003520| 20 73 69 6d 70 6c 65 20 | 61 6c 65 72 74 20 74 68 | simple |alert th|
|00003530| 61 74 20 6a 75 73 74 20 | 73 61 79 73 20 61 6e 20 |at just |says an |
|00003540| 65 72 72 6f 72 20 6f 63 | 63 75 72 72 65 64 20 61 |error oc|curred a|
|00003550| 6e 64 20 74 68 65 6e 20 | 63 61 6c 6c 73 20 45 78 |nd then |calls Ex|
|00003560| 69 74 54 6f 53 68 65 6c | 6c 2e 0d 09 53 69 6e 63 |itToShel|l...Sinc|
|00003570| 65 20 74 68 65 72 65 20 | 69 73 20 6e 6f 20 6f 74 |e there |is no ot|
|00003580| 68 65 72 20 63 6c 65 61 | 6e 75 70 20 6e 65 65 64 |her clea|nup need|
|00003590| 65 64 20 61 74 20 74 68 | 69 73 20 70 6f 69 6e 74 |ed at th|is point|
|000035a0| 20 69 66 20 61 6e 20 65 | 72 72 6f 72 20 69 73 20 | if an e|rror is |
|000035b0| 64 65 74 65 63 74 65 64 | 2c 0d 09 74 68 69 73 20 |detected|,..this |
|000035c0| 66 6f 72 6d 20 6f 66 20 | 65 72 72 6f 72 2d 20 68 |form of |error- h|
|000035d0| 61 6e 64 6c 69 6e 67 20 | 69 73 20 61 63 63 65 70 |andling |is accep|
|000035e0| 74 61 62 6c 65 2e 20 49 | 66 20 6d 6f 72 65 20 73 |table. I|f more s|
|000035f0| 6f 70 68 69 73 74 69 63 | 61 74 65 64 20 65 72 72 |ophistic|ated err|
|00003600| 6f 72 20 72 65 63 6f 76 | 65 72 79 0d 09 69 73 20 |or recov|ery..is |
|00003610| 6e 65 65 64 65 64 2c 20 | 61 6e 20 65 78 63 65 70 |needed, |an excep|
|00003620| 74 69 6f 6e 20 6d 65 63 | 68 61 6e 69 73 6d 2c 20 |tion mec|hanism, |
|00003630| 73 75 63 68 20 61 73 20 | 69 73 20 70 72 6f 76 69 |such as |is provi|
|00003640| 64 65 64 20 62 79 20 53 | 69 67 6e 61 6c 73 2c 20 |ded by S|ignals, |
|00003650| 63 61 6e 20 62 65 20 75 | 73 65 64 2e 20 2a 2f 0d |can be u|sed. */.|
|00003660| 0d 23 70 72 61 67 6d 61 | 20 73 65 67 6d 65 6e 74 |.#pragma| segment|
|00003670| 20 49 6e 69 74 69 61 6c | 69 7a 65 0d 76 6f 69 64 | Initial|ize.void|
|00003680| 20 49 6e 69 74 69 61 6c | 69 7a 65 28 29 0d 7b 0d | Initial|ize().{.|
|00003690| 09 48 61 6e 64 6c 65 09 | 09 6d 65 6e 75 42 61 72 |.Handle.|.menuBar|
|000036a0| 3b 0d 09 6c 6f 6e 67 09 | 09 74 6f 74 61 6c 2c 20 |;..long.|.total, |
|000036b0| 63 6f 6e 74 69 67 3b 0d | 09 45 76 65 6e 74 52 65 |contig;.|.EventRe|
|000036c0| 63 6f 72 64 20 65 76 65 | 6e 74 3b 0d 09 73 68 6f |cord eve|nt;..sho|
|000036d0| 72 74 09 09 63 6f 75 6e | 74 2c 0d 09 09 09 09 6d |rt..coun|t,.....m|
|000036e0| 79 50 72 69 6e 74 45 72 | 72 3b 0d 09 09 09 09 0d |yPrintEr|r;......|
|000036f0| 09 49 6e 69 74 47 72 61 | 66 28 28 50 74 72 29 20 |.InitGra|f((Ptr) |
|00003700| 26 71 64 2e 74 68 65 50 | 6f 72 74 29 3b 0d 09 49 |&qd.theP|ort);..I|
|00003710| 6e 69 74 46 6f 6e 74 73 | 28 29 3b 0d 09 49 6e 69 |nitFonts|();..Ini|
|00003720| 74 57 69 6e 64 6f 77 73 | 28 29 3b 0d 09 49 6e 69 |tWindows|();..Ini|
|00003730| 74 4d 65 6e 75 73 28 29 | 3b 0d 09 54 45 49 6e 69 |tMenus()|;..TEIni|
|00003740| 74 28 29 3b 0d 09 49 6e | 69 74 44 69 61 6c 6f 67 |t();..In|itDialog|
|00003750| 73 28 6e 69 6c 29 3b 0d | 09 49 6e 69 74 43 75 72 |s(nil);.|.InitCur|
|00003760| 73 6f 72 28 29 3b 0d 09 | 0d 20 20 20 20 4d 61 78 |sor();..|. Max|
|00003770| 41 70 70 6c 5a 6f 6e 65 | 28 29 3b 20 4d 6f 72 65 |ApplZone|(); More|
|00003780| 4d 61 73 74 65 72 73 28 | 29 3b 20 4d 6f 72 65 4d |Masters(|); MoreM|
|00003790| 61 73 74 65 72 73 3b 0d | 0d 09 66 6f 72 20 28 63 |asters;.|..for (c|
|000037a0| 6f 75 6e 74 20 3d 20 31 | 3b 20 63 6f 75 6e 74 20 |ount = 1|; count |
|000037b0| 3c 3d 20 33 3b 20 63 6f | 75 6e 74 2b 2b 29 0d 09 |<= 3; co|unt++)..|
|000037c0| 09 45 76 65 6e 74 41 76 | 61 69 6c 28 65 76 65 72 |.EventAv|ail(ever|
|000037d0| 79 45 76 65 6e 74 2c 20 | 26 65 76 65 6e 74 29 3b |yEvent, |&event);|
|000037e0| 0d 09 0d 09 20 0d 09 53 | 79 73 45 6e 76 69 72 6f |.... ..S|ysEnviro|
|000037f0| 6e 73 28 6b 53 79 73 45 | 6e 76 69 72 6f 6e 73 56 |ns(kSysE|nvironsV|
|00003800| 65 72 73 69 6f 6e 2c 20 | 26 67 4d 61 63 29 3b 0d |ersion, |&gMac);.|
|00003810| 09 0d 09 0d 09 69 66 20 | 28 67 4d 61 63 2e 6d 61 |.....if |(gMac.ma|
|00003820| 63 68 69 6e 65 54 79 70 | 65 20 3c 20 30 29 20 41 |chineTyp|e < 0) A|
|00003830| 6c 65 72 74 55 73 65 72 | 28 29 3b 0d 09 0d 0d 09 |lertUser|();.....|
|00003840| 2f 2f 20 57 65 20 6e 65 | 65 64 20 74 68 65 20 47 |// We ne|ed the G|
|00003850| 57 6f 72 6c 64 20 73 74 | 75 66 66 20 28 69 2e 65 |World st|uff (i.e|
|00003860| 2e 20 33 32 2d 62 69 74 | 20 51 44 29 20 77 68 65 |. 32-bit| QD) whe|
|00003870| 6e 20 70 72 69 6e 74 69 | 6e 67 20 69 6e 20 22 64 |n printi|ng in "d|
|00003880| 72 61 66 74 22 20 6d 6f | 64 65 2e 2e 2e 0d 09 69 |raft" mo|de.....i|
|00003890| 66 20 28 67 4d 61 63 2e | 68 61 73 43 6f 6c 6f 72 |f (gMac.|hasColor|
|000038a0| 51 44 29 0d 09 7b 0d 09 | 20 20 2f 2f 20 43 68 65 |QD)..{..| // Che|
|000038b0| 63 6b 20 74 6f 20 6d 61 | 6b 65 20 73 75 72 65 20 |ck to ma|ke sure |
|000038c0| 74 68 65 20 33 32 2d 42 | 69 74 20 51 75 69 63 6b |the 32-B|it Quick|
|000038d0| 44 72 61 77 20 74 72 61 | 70 20 65 78 69 73 74 73 |Draw tra|p exists|
|000038e0| 0d 09 20 20 69 66 20 28 | 4e 47 65 74 54 72 61 70 |.. if (|NGetTrap|
|000038f0| 41 64 64 72 65 73 73 28 | 51 44 33 32 54 72 61 70 |Address(|QD32Trap|
|00003900| 2c 20 54 6f 6f 6c 54 72 | 61 70 29 20 3d 3d 20 20 |, ToolTr|ap) == |
|00003910| 47 65 74 54 72 61 70 41 | 64 64 72 65 73 73 28 55 |GetTrapA|ddress(U|
|00003920| 6e 69 6d 70 6c 65 6d 65 | 6e 74 65 64 29 29 0d 09 |nimpleme|nted))..|
|00003930| 20 20 20 20 51 44 33 32 | 42 69 74 41 6c 65 72 74 | QD32|BitAlert|
|00003940| 55 73 65 72 28 29 3b 0d | 20 09 7d 0d 09 65 6c 73 |User();.| .}..els|
|00003950| 65 20 20 51 44 33 32 42 | 69 74 41 6c 65 72 74 55 |e QD32B|itAlertU|
|00003960| 73 65 72 28 29 3b 0d 09 | 0d 09 0d 09 67 48 61 73 |ser();..|....gHas|
|00003970| 57 61 69 74 4e 65 78 74 | 45 76 65 6e 74 20 3d 20 |WaitNext|Event = |
|00003980| 54 72 61 70 41 76 61 69 | 6c 61 62 6c 65 28 5f 57 |TrapAvai|lable(_W|
|00003990| 61 69 74 4e 65 78 74 45 | 76 65 6e 74 2c 20 54 6f |aitNextE|vent, To|
|000039a0| 6f 6c 54 72 61 70 29 3b | 0d 0d 09 69 66 20 28 28 |olTrap);|...if ((|
|000039b0| 6c 6f 6e 67 29 20 47 65 | 74 41 70 70 6c 4c 69 6d |long) Ge|tApplLim|
|000039c0| 69 74 28 29 20 2d 20 28 | 6c 6f 6e 67 29 20 41 70 |it() - (|long) Ap|
|000039d0| 70 6c 69 63 5a 6f 6e 65 | 28 29 20 3c 20 6b 4d 69 |plicZone|() < kMi|
|000039e0| 6e 48 65 61 70 29 20 41 | 6c 65 72 74 55 73 65 72 |nHeap) A|lertUser|
|000039f0| 28 29 3b 0d 09 0d 09 0d | 09 50 75 72 67 65 53 70 |();.....|.PurgeSp|
|00003a00| 61 63 65 28 26 74 6f 74 | 61 6c 2c 20 26 63 6f 6e |ace(&tot|al, &con|
|00003a10| 74 69 67 29 3b 0d 09 69 | 66 20 28 74 6f 74 61 6c |tig);..i|f (total|
|00003a20| 20 3c 20 6b 4d 69 6e 53 | 70 61 63 65 29 20 41 6c | < kMinS|pace) Al|
|00003a30| 65 72 74 55 73 65 72 28 | 29 3b 0d 09 0d 0d 09 6d |ertUser(|);.....m|
|00003a40| 65 6e 75 42 61 72 20 3d | 20 47 65 74 4e 65 77 4d |enuBar =| GetNewM|
|00003a50| 42 61 72 28 72 4d 65 6e | 75 42 61 72 29 3b 09 09 |Bar(rMen|uBar);..|
|00003a60| 09 2f 2a 20 72 65 61 64 | 20 6d 65 6e 75 73 20 69 |./* read| menus i|
|00003a70| 6e 74 6f 20 6d 65 6e 75 | 20 62 61 72 20 2a 2f 0d |nto menu| bar */.|
|00003a80| 09 69 66 20 28 20 6d 65 | 6e 75 42 61 72 20 3d 3d |.if ( me|nuBar ==|
|00003a90| 20 6e 69 6c 20 29 20 41 | 6c 65 72 74 55 73 65 72 | nil ) A|lertUser|
|00003aa0| 28 29 3b 0d 09 53 65 74 | 4d 65 6e 75 42 61 72 28 |();..Set|MenuBar(|
|00003ab0| 6d 65 6e 75 42 61 72 29 | 3b 09 09 09 09 09 2f 2a |menuBar)|;...../*|
|00003ac0| 20 69 6e 73 74 61 6c 6c | 20 6d 65 6e 75 73 20 2a | install| menus *|
|00003ad0| 2f 0d 09 44 69 73 70 6f | 73 48 61 6e 64 6c 65 28 |/..Dispo|sHandle(|
|00003ae0| 6d 65 6e 75 42 61 72 29 | 3b 0d 09 41 64 64 52 65 |menuBar)|;..AddRe|
|00003af0| 73 4d 65 6e 75 28 47 65 | 74 4d 48 61 6e 64 6c 65 |sMenu(Ge|tMHandle|
|00003b00| 28 6d 41 70 70 6c 65 29 | 2c 20 27 44 52 56 52 27 |(mApple)|, 'DRVR'|
|00003b10| 29 3b 09 2f 2a 20 61 64 | 64 20 44 41 20 6e 61 6d |);./* ad|d DA nam|
|00003b20| 65 73 20 74 6f 20 41 70 | 70 6c 65 20 6d 65 6e 75 |es to Ap|ple menu|
|00003b30| 20 2a 2f 0d 09 44 72 61 | 77 4d 65 6e 75 42 61 72 | */..Dra|wMenuBar|
|00003b40| 28 29 3b 0d 09 0d 09 2f | 2a 2a 0d 09 20 20 20 20 |();..../|**.. |
|00003b50| 49 6e 69 74 69 61 6c 69 | 7a 65 20 74 68 65 73 65 |Initiali|ze these|
|00003b60| 20 62 6f 6f 6c 65 61 6e | 73 20 74 6f 20 65 6e 61 | boolean|s to ena|
|00003b70| 62 6c 65 20 74 68 65 20 | 70 72 69 6e 74 20 6c 6f |ble the |print lo|
|00003b80| 6f 70 20 28 69 6e 20 50 | 72 47 65 6e 65 72 61 6c |op (in P|rGeneral|
|00003b90| 50 6c 61 79 50 72 69 6e | 74 2e 63 29 0d 09 09 74 |PlayPrin|t.c)...t|
|00003ba0| 6f 20 64 65 74 65 72 6d | 69 6e 65 20 77 68 69 63 |o determ|ine whic|
|00003bb0| 68 20 50 72 47 65 6e 65 | 72 61 6c 20 6f 70 63 6f |h PrGene|ral opco|
|00003bc0| 64 65 73 20 73 68 6f 75 | 6c 64 20 62 65 20 75 73 |des shou|ld be us|
|00003bd0| 65 64 20 61 74 20 70 72 | 69 6e 74 20 74 69 6d 65 |ed at pr|int time|
|00003be0| 2e 0d 20 20 20 20 20 2a | 2a 2f 0d 09 67 48 69 67 |.. *|*/..gHig|
|00003bf0| 68 52 65 73 6f 6c 75 74 | 69 6f 6e 4f 4e 20 3d 20 |hResolut|ionON = |
|00003c00| 66 61 6c 73 65 3b 20 20 | 20 0d 09 67 55 73 65 44 |false; | ..gUseD|
|00003c10| 72 61 66 74 42 69 74 73 | 20 3d 20 66 61 6c 73 65 |raftBits| = false|
|00003c20| 3b 0d 09 67 43 68 65 63 | 6b 46 6f 72 4c 61 6e 64 |;..gChec|kForLand|
|00003c30| 73 63 61 70 65 20 3d 20 | 66 61 6c 73 65 3b 0d 09 |scape = |false;..|
|00003c40| 67 44 72 61 66 74 42 69 | 74 73 48 61 73 42 65 65 |gDraftBi|tsHasBee|
|00003c50| 6e 53 65 74 20 3d 20 66 | 61 6c 73 65 3b 0d 09 0d |nSet = f|alse;...|
|00003c60| 09 2f 2a 2a 0d 09 20 20 | 20 20 57 65 20 77 69 6c |./**.. | We wil|
|00003c70| 6c 20 61 73 73 75 6d 65 | 20 61 74 20 74 68 69 73 |l assume| at this|
|00003c80| 20 70 6f 69 6e 74 20 74 | 68 61 74 20 61 6c 6c 20 | point t|hat all |
|00003c90| 6f 66 20 50 72 47 65 6e | 65 72 61 6c 27 73 20 6f |of PrGen|eral's o|
|00003ca0| 70 63 6f 64 65 73 20 61 | 72 65 20 73 75 70 70 6f |pcodes a|re suppo|
|00003cb0| 72 74 65 64 2e 0d 09 09 | 57 68 65 6e 20 77 65 20 |rted....|When we |
|00003cc0| 6d 61 6b 65 20 61 20 63 | 61 6c 6c 20 66 6f 72 20 |make a c|all for |
|00003cd0| 61 20 70 61 72 74 69 63 | 75 6c 61 72 20 6f 70 63 |a partic|ular opc|
|00003ce0| 6f 64 65 2c 20 77 65 20 | 77 69 6c 6c 20 63 68 65 |ode, we |will che|
|00003cf0| 63 6b 20 74 6f 20 6d 61 | 6b 65 20 73 75 72 65 20 |ck to ma|ke sure |
|00003d00| 74 68 61 74 20 0d 09 09 | 74 68 65 20 6f 70 63 6f |that ...|the opco|
|00003d10| 64 65 20 69 73 20 73 75 | 70 70 6f 72 74 65 64 2e |de is su|pported.|
|00003d20| 20 20 49 66 20 69 74 20 | 69 73 20 4e 4f 54 2c 20 | If it |is NOT, |
|00003d30| 74 68 65 20 61 70 70 72 | 6f 70 72 61 69 74 65 20 |the appr|opraite |
|00003d40| 66 6c 61 67 20 77 69 6c | 6c 20 62 65 20 73 65 74 |flag wil|l be set|
|00003d50| 20 74 6f 20 66 61 6c 73 | 65 0d 09 09 61 6e 64 20 | to fals|e...and |
|00003d60| 74 68 61 74 20 6f 70 63 | 6f 64 65 20 77 69 6c 6c |that opc|ode will|
|00003d70| 20 6e 6f 74 20 62 65 20 | 63 61 6c 6c 65 64 20 75 | not be |called u|
|00003d80| 6e 74 69 6c 20 74 68 65 | 20 70 72 69 6e 74 65 72 |ntil the| printer|
|00003d90| 20 64 72 69 76 65 72 20 | 69 73 20 63 68 61 6e 67 | driver |is chang|
|00003da0| 65 64 2e 0d 09 2a 2a 2f | 0d 09 67 4c 61 6e 64 73 |ed...**/|..gLands|
|00003db0| 63 61 70 65 4f 70 49 6d | 70 6c 20 3d 20 74 72 75 |capeOpIm|pl = tru|
|00003dc0| 65 3b 0d 09 67 44 72 61 | 66 74 42 69 74 73 4f 70 |e;..gDra|ftBitsOp|
|00003dd0| 49 6d 70 6c 20 3d 20 74 | 72 75 65 3b 0d 09 67 53 |Impl = t|rue;..gS|
|00003de0| 65 74 52 73 6c 4f 70 49 | 6d 70 6c 20 3d 20 74 72 |etRslOpI|mpl = tr|
|00003df0| 75 65 3b 0d 0d 09 2f 2a | 2a 0d 09 20 20 20 20 43 |ue;.../*|*.. C|
|00003e00| 72 65 61 74 65 20 26 20 | 69 6e 69 74 69 61 6c 69 |reate & |initiali|
|00003e10| 7a 65 20 74 68 65 20 70 | 72 69 6e 74 20 72 65 63 |ze the p|rint rec|
|00003e20| 6f 72 64 2e 2e 2e 2e 0d | 20 20 20 20 20 2a 2a 2f |ord.....| **/|
|00003e30| 0d 09 20 6d 79 50 72 69 | 6e 74 45 72 72 20 3d 20 |.. myPri|ntErr = |
|00003e40| 30 3b 0d 09 20 67 50 72 | 52 65 63 48 64 6c 20 3d |0;.. gPr|RecHdl =|
|00003e50| 20 28 54 48 50 72 69 6e | 74 29 20 4e 65 77 48 61 | (THPrin|t) NewHa|
|00003e60| 6e 64 6c 65 28 73 69 7a | 65 6f 66 28 54 50 72 69 |ndle(siz|eof(TPri|
|00003e70| 6e 74 29 29 3b 0d 0d 0d | 09 20 69 66 20 28 4d 65 |nt));...|. if (Me|
|00003e80| 6d 45 72 72 6f 72 28 29 | 20 3d 3d 20 6e 6f 45 72 |mError()| == noEr|
|00003e90| 72 20 26 26 20 67 50 72 | 52 65 63 48 64 6c 20 21 |r && gPr|RecHdl !|
|00003ea0| 3d 20 6e 69 6c 29 0d 09 | 20 20 7b 0d 09 20 20 20 |= nil)..| {.. |
|00003eb0| 50 72 4f 70 65 6e 28 29 | 3b 20 0d 09 20 20 20 20 |PrOpen()|; .. |
|00003ec0| 69 66 20 28 50 72 45 72 | 72 6f 72 28 29 20 3d 3d |if (PrEr|ror() ==|
|00003ed0| 20 6e 6f 45 72 72 29 0d | 09 09 20 20 7b 0d 09 20 | noErr).|.. {.. |
|00003ee0| 20 20 20 20 20 20 50 72 | 69 6e 74 44 65 66 61 75 | Pr|intDefau|
|00003ef0| 6c 74 20 28 67 50 72 52 | 65 63 48 64 6c 29 3b 0d |lt (gPrR|ecHdl);.|
|00003f00| 09 0d 09 09 20 20 20 2f | 2f 20 57 65 20 6e 65 65 |.... /|/ We nee|
|00003f10| 64 20 74 6f 20 73 61 76 | 65 20 74 68 65 20 76 65 |d to sav|e the ve|
|00003f20| 72 73 69 6f 6e 20 6e 75 | 6d 62 65 72 20 6f 66 20 |rsion nu|mber of |
|00003f30| 74 68 65 20 63 75 72 72 | 65 6e 74 20 70 72 69 6e |the curr|ent prin|
|00003f40| 74 65 72 20 64 72 69 76 | 65 72 2e 20 20 54 68 69 |ter driv|er. Thi|
|00003f50| 73 20 77 69 6c 6c 20 65 | 6e 61 62 6c 65 0d 09 09 |s will e|nable...|
|00003f60| 20 20 20 2f 2f 20 75 73 | 20 74 6f 20 63 6f 6d 70 | // us| to comp|
|00003f70| 61 72 65 20 74 68 65 20 | 76 65 72 73 69 6f 6e 20 |are the |version |
|00003f80| 6f 66 20 74 68 65 20 70 | 72 69 6e 74 65 72 20 64 |of the p|rinter d|
|00003f90| 72 69 76 65 72 20 77 68 | 65 6e 20 74 68 65 20 75 |river wh|en the u|
|00003fa0| 73 65 72 20 63 68 6f 6f | 73 65 73 20 61 20 64 69 |ser choo|ses a di|
|00003fb0| 66 66 65 72 65 6e 74 0d | 09 09 20 20 20 2f 2f 20 |fferent.|.. // |
|00003fc0| 70 72 69 6e 74 65 72 20 | 64 72 69 76 65 72 20 76 |printer |driver v|
|00003fd0| 69 61 20 74 68 65 20 43 | 68 6f 6f 73 65 72 2e 20 |ia the C|hooser. |
|00003fe0| 20 54 68 69 73 20 69 6d | 70 6f 72 74 61 6e 74 20 | This im|portant |
|00003ff0| 62 65 63 61 75 73 65 20 | 73 6f 6d 65 20 65 61 72 |because |some ear|
|00004000| 6c 69 65 72 20 76 65 72 | 73 69 6f 6e 73 20 6f 66 |lier ver|sions of|
|00004010| 20 0d 09 09 20 20 20 2f | 2f 20 41 70 70 6c 65 27 | ... /|/ Apple'|
|00004020| 73 20 70 72 69 6e 74 65 | 72 73 20 64 72 69 76 65 |s printe|rs drive|
|00004030| 72 73 20 64 69 64 20 6e | 6f 74 20 73 75 70 70 6f |rs did n|ot suppo|
|00004040| 72 74 20 50 72 47 65 6e | 65 72 61 6c 2e 20 20 57 |rt PrGen|eral. W|
|00004050| 68 69 63 68 20 69 73 20 | 74 68 65 20 63 61 73 65 |hich is |the case|
|00004060| 20 66 6f 72 20 74 68 65 | 20 0d 09 09 20 20 20 2f | for the| ... /|
|00004070| 2f 20 49 6d 61 67 65 57 | 72 69 74 65 72 20 76 32 |/ ImageW|riter v2|
|00004080| 2e 35 20 61 6e 64 20 4c | 61 73 65 72 57 72 69 74 |.5 and L|aserWrit|
|00004090| 65 72 20 76 34 2e 30 20 | 61 6e 64 20 65 61 72 6c |er v4.0 |and earl|
|000040a0| 69 65 72 2e 0d 0d 09 09 | 20 20 20 67 4f 72 69 67 |ier.....| gOrig|
|000040b0| 69 6e 61 6c 44 72 69 76 | 65 72 56 65 72 73 20 3d |inalDriv|erVers =|
|000040c0| 20 50 72 44 72 76 72 56 | 65 72 73 20 28 29 3b 0d | PrDrvrV|ers ();.|
|000040d0| 09 09 20 20 20 0d 09 09 | 20 20 20 69 66 20 28 50 |.. ...| if (P|
|000040e0| 72 45 72 72 6f 72 20 28 | 29 20 3d 3d 20 6e 6f 45 |rError (|) == noE|
|000040f0| 72 72 29 0d 09 20 20 20 | 20 20 20 20 20 20 67 50 |rr).. | gP|
|00004100| 72 47 65 6e 65 72 61 6c | 4c 69 76 65 73 20 3d 20 |rGeneral|Lives = |
|00004110| 74 65 73 74 46 6f 72 50 | 72 47 65 6e 65 72 61 6c |testForP|rGeneral|
|00004120| 20 28 29 3b 20 20 2f 2f | 20 43 68 65 63 6b 20 74 | (); //| Check t|
|00004130| 6f 20 73 65 65 20 69 66 | 20 74 68 65 20 63 75 72 |o see if| the cur|
|00004140| 72 65 6e 74 20 70 72 69 | 6e 74 65 72 20 64 72 69 |rent pri|nter dri|
|00004150| 76 65 72 20 0d 09 20 09 | 20 20 20 65 6c 73 65 20 |ver .. .| else |
|00004160| 6d 79 50 72 69 6e 74 45 | 72 72 20 3d 20 50 72 45 |myPrintE|rr = PrE|
|00004170| 72 72 6f 72 20 28 29 3b | 09 09 09 20 2f 2f 20 73 |rror ();|... // s|
|00004180| 75 70 70 6f 72 74 73 20 | 50 72 47 65 6e 65 72 61 |upports |PrGenera|
|00004190| 6c 20 61 6e 64 20 73 65 | 74 20 74 68 65 20 67 6c |l and se|t the gl|
|000041a0| 6f 62 61 6c 20 66 6c 61 | 67 2e 2e 2e 0d 09 20 09 |obal fla|g..... .|
|000041b0| 20 20 7d 0d 09 09 65 6c | 73 65 20 6d 79 50 72 69 | }...el|se myPri|
|000041c0| 6e 74 45 72 72 20 3d 20 | 50 72 45 72 72 6f 72 20 |ntErr = |PrError |
|000041d0| 28 29 3b 20 20 20 20 2f | 2f 20 47 72 61 62 20 74 |(); /|/ Grab t|
|000041e0| 68 65 20 65 72 72 6f 72 | 20 62 65 66 6f 72 65 20 |he error| before |
|000041f0| 77 65 20 63 6c 6f 73 65 | 20 74 68 65 20 50 72 69 |we close| the Pri|
|00004200| 6e 74 20 4d 61 6e 61 67 | 65 72 0d 20 20 20 20 20 |nt Manag|er. |
|00004210| 20 20 50 72 43 6c 6f 73 | 65 28 29 3b 0d 09 20 20 | PrClos|e();.. |
|00004220| 0d 09 20 20 20 69 66 20 | 28 6d 79 50 72 69 6e 74 |.. if |(myPrint|
|00004230| 45 72 72 20 21 3d 20 30 | 29 20 20 0d 09 20 20 20 |Err != 0|) .. |
|00004240| 20 20 41 6c 65 72 74 55 | 73 65 72 20 28 29 3b 0d | AlertU|ser ();.|
|00004250| 09 20 20 7d 0d 09 20 65 | 6c 73 65 20 20 41 6c 65 |. }.. e|lse Ale|
|00004260| 72 74 55 73 65 72 20 28 | 29 3b 0d 09 20 0d 7d 20 |rtUser (|);.. .} |
|00004270| 2f 2a 49 6e 69 74 69 61 | 6c 69 7a 65 2a 2f 0d 0d |/*Initia|lize*/..|
|00004280| 0d 2f 2a 20 43 68 65 63 | 6b 20 74 6f 20 73 65 65 |./* Chec|k to see|
|00004290| 20 69 66 20 61 20 77 69 | 6e 64 6f 77 20 62 65 6c | if a wi|ndow bel|
|000042a0| 6f 6e 67 73 20 74 6f 20 | 61 20 64 65 73 6b 20 61 |ongs to |a desk a|
|000042b0| 63 63 65 73 73 6f 72 79 | 2e 20 2a 2f 0d 0d 23 70 |ccessory|. */..#p|
|000042c0| 72 61 67 6d 61 20 73 65 | 67 6d 65 6e 74 20 4d 61 |ragma se|gment Ma|
|000042d0| 69 6e 0d 42 6f 6f 6c 65 | 61 6e 20 49 73 44 41 57 |in.Boole|an IsDAW|
|000042e0| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 29 0d 09 57 |indow(wi|ndow)..W|
|000042f0| 69 6e 64 6f 77 50 74 72 | 09 77 69 6e 64 6f 77 3b |indowPtr|.window;|
|00004300| 0d 7b 0d 09 69 66 20 28 | 20 77 69 6e 64 6f 77 20 |.{..if (| window |
|00004310| 3d 3d 20 6e 69 6c 20 29 | 0d 09 09 72 65 74 75 72 |== nil )|...retur|
|00004320| 6e 20 66 61 6c 73 65 3b | 0d 09 65 6c 73 65 09 2f |n false;|..else./|
|00004330| 2a 20 44 41 20 77 69 6e | 64 6f 77 73 20 68 61 76 |* DA win|dows hav|
|00004340| 65 20 6e 65 67 61 74 69 | 76 65 20 77 69 6e 64 6f |e negati|ve windo|
|00004350| 77 4b 69 6e 64 73 20 2a | 2f 0d 09 09 72 65 74 75 |wKinds *|/...retu|
|00004360| 72 6e 20 28 28 57 69 6e | 64 6f 77 50 65 65 6b 29 |rn ((Win|dowPeek)|
|00004370| 20 77 69 6e 64 6f 77 29 | 2d 3e 77 69 6e 64 6f 77 | window)|->window|
|00004380| 4b 69 6e 64 20 3c 20 30 | 3b 0d 7d 20 2f 2a 49 73 |Kind < 0|;.} /*Is|
|00004390| 44 41 57 69 6e 64 6f 77 | 2a 2f 0d 0d 0d 2f 2a 09 |DAWindow|*/.../*.|
|000043a0| 43 68 65 63 6b 20 74 6f | 20 73 65 65 20 69 66 20 |Check to| see if |
|000043b0| 61 20 67 69 76 65 6e 20 | 74 72 61 70 20 69 73 20 |a given |trap is |
|000043c0| 69 6d 70 6c 65 6d 65 6e | 74 65 64 2e 20 54 68 69 |implemen|ted. Thi|
|000043d0| 73 20 69 73 20 6f 6e 6c | 79 20 75 73 65 64 20 62 |s is onl|y used b|
|000043e0| 79 20 74 68 65 0d 09 49 | 6e 69 74 69 61 6c 69 7a |y the..I|nitializ|
|000043f0| 65 20 72 6f 75 74 69 6e | 65 20 69 6e 20 74 68 69 |e routin|e in thi|
|00004400| 73 20 70 72 6f 67 72 61 | 6d 2c 20 73 6f 20 77 65 |s progra|m, so we|
|00004410| 20 70 75 74 20 69 74 20 | 69 6e 20 74 68 65 20 49 | put it |in the I|
|00004420| 6e 69 74 69 61 6c 69 7a | 65 20 73 65 67 6d 65 6e |nitializ|e segmen|
|00004430| 74 2e 0d 09 54 68 65 20 | 72 65 63 6f 6d 6d 65 6e |t...The |recommen|
|00004440| 64 65 64 20 61 70 70 72 | 6f 61 63 68 20 74 6f 20 |ded appr|oach to |
|00004450| 73 65 65 20 69 66 20 61 | 20 74 72 61 70 20 69 73 |see if a| trap is|
|00004460| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 69 73 20 | impleme|nted is |
|00004470| 74 6f 20 73 65 65 20 69 | 66 0d 09 74 68 65 20 61 |to see i|f..the a|
|00004480| 64 64 72 65 73 73 20 6f | 66 20 74 68 65 20 74 72 |ddress o|f the tr|
|00004490| 61 70 20 72 6f 75 74 69 | 6e 65 20 69 73 20 74 68 |ap routi|ne is th|
|000044a0| 65 20 73 61 6d 65 20 61 | 73 20 74 68 65 20 61 64 |e same a|s the ad|
|000044b0| 64 72 65 73 73 20 6f 66 | 20 74 68 65 0d 09 55 6e |dress of| the..Un|
|000044c0| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 74 72 61 70 |implemen|ted trap|
|000044d0| 2e 20 2a 2f 0d 2f 2a 09 | 31 2e 30 32 20 2d 20 4e |. */./*.|1.02 - N|
|000044e0| 65 65 64 73 20 74 6f 20 | 62 65 20 63 61 6c 6c 65 |eeds to |be calle|
|000044f0| 64 20 61 66 74 65 72 20 | 63 61 6c 6c 20 74 6f 20 |d after |call to |
|00004500| 53 79 73 45 6e 76 69 72 | 6f 6e 73 20 73 6f 20 74 |SysEnvir|ons so t|
|00004510| 68 61 74 20 69 74 20 63 | 61 6e 20 63 68 65 63 6b |hat it c|an check|
|00004520| 0d 09 69 66 20 61 20 54 | 6f 6f 6c 54 72 61 70 20 |..if a T|oolTrap |
|00004530| 69 73 20 6f 75 74 20 6f | 66 20 72 61 6e 67 65 20 |is out o|f range |
|00004540| 6f 66 20 61 20 70 72 65 | 2d 4d 61 63 49 49 20 52 |of a pre|-MacII R|
|00004550| 4f 4d 2e 20 2a 2f 0d 0d | 23 70 72 61 67 6d 61 20 |OM. */..|#pragma |
|00004560| 73 65 67 6d 65 6e 74 20 | 49 6e 69 74 69 61 6c 69 |segment |Initiali|
|00004570| 7a 65 0d 42 6f 6f 6c 65 | 61 6e 20 54 72 61 70 41 |ze.Boole|an TrapA|
|00004580| 76 61 69 6c 61 62 6c 65 | 28 74 4e 75 6d 62 65 72 |vailable|(tNumber|
|00004590| 2c 74 54 79 70 65 29 0d | 09 73 68 6f 72 74 09 09 |,tType).|.short..|
|000045a0| 74 4e 75 6d 62 65 72 3b | 0d 09 54 72 61 70 54 79 |tNumber;|..TrapTy|
|000045b0| 70 65 09 74 54 79 70 65 | 3b 0d 7b 0d 09 69 66 20 |pe.tType|;.{..if |
|000045c0| 28 20 28 20 74 54 79 70 | 65 20 3d 3d 20 54 6f 6f |( ( tTyp|e == Too|
|000045d0| 6c 54 72 61 70 20 29 20 | 26 26 0d 09 09 28 20 67 |lTrap ) |&&...( g|
|000045e0| 4d 61 63 2e 6d 61 63 68 | 69 6e 65 54 79 70 65 20 |Mac.mach|ineType |
|000045f0| 3e 20 65 6e 76 4d 61 63 | 68 55 6e 6b 6e 6f 77 6e |> envMac|hUnknown|
|00004600| 20 29 20 26 26 0d 09 09 | 28 20 67 4d 61 63 2e 6d | ) &&...|( gMac.m|
|00004610| 61 63 68 69 6e 65 54 79 | 70 65 20 3c 20 65 6e 76 |achineTy|pe < env|
|00004620| 4d 61 63 49 49 20 29 20 | 29 20 7b 09 09 2f 2a 20 |MacII ) |) {../* |
|00004630| 69 74 27 73 20 61 20 35 | 31 32 4b 45 2c 20 50 6c |it's a 5|12KE, Pl|
|00004640| 75 73 2c 20 6f 72 20 53 | 45 20 2a 2f 0d 09 09 74 |us, or S|E */...t|
|00004650| 4e 75 6d 62 65 72 20 3d | 20 74 4e 75 6d 62 65 72 |Number =| tNumber|
|00004660| 20 26 20 30 78 30 33 46 | 46 3b 0d 09 09 69 66 20 | & 0x03F|F;...if |
|00004670| 28 20 74 4e 75 6d 62 65 | 72 20 3e 20 30 78 30 31 |( tNumbe|r > 0x01|
|00004680| 46 46 20 29 09 09 09 09 | 09 2f 2a 20 77 68 69 63 |FF )....|./* whic|
|00004690| 68 20 6d 65 61 6e 73 20 | 74 68 65 20 74 6f 6f 6c |h means |the tool|
|000046a0| 20 74 72 61 70 73 20 2a | 2f 0d 09 09 09 74 4e 75 | traps *|/....tNu|
|000046b0| 6d 62 65 72 20 3d 20 5f | 55 6e 69 6d 70 6c 65 6d |mber = _|Unimplem|
|000046c0| 65 6e 74 65 64 3b 09 09 | 09 2f 2a 20 6f 6e 6c 79 |ented;..|./* only|
|000046d0| 20 67 6f 20 74 6f 20 30 | 78 30 31 46 46 20 2a 2f | go to 0|x01FF */|
|000046e0| 0d 09 7d 0d 09 72 65 74 | 75 72 6e 20 4e 47 65 74 |..}..ret|urn NGet|
|000046f0| 54 72 61 70 41 64 64 72 | 65 73 73 28 74 4e 75 6d |TrapAddr|ess(tNum|
|00004700| 62 65 72 2c 20 74 54 79 | 70 65 29 20 21 3d 20 47 |ber, tTy|pe) != G|
|00004710| 65 74 54 72 61 70 41 64 | 64 72 65 73 73 28 5f 55 |etTrapAd|dress(_U|
|00004720| 6e 69 6d 70 6c 65 6d 65 | 6e 74 65 64 29 3b 0d 7d |nimpleme|nted);.}|
|00004730| 20 2f 2a 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 | /*TrapA|vailable|
|00004740| 2a 2f 0d 0d 0d 0d 2f 2a | 09 44 69 73 70 6c 61 79 |*/..../*|.Display|
|00004750| 20 61 6e 20 61 6c 65 72 | 74 20 74 68 61 74 20 74 | an aler|t that t|
|00004760| 65 6c 6c 73 20 74 68 65 | 20 75 73 65 72 20 61 6e |ells the| user an|
|00004770| 20 65 72 72 6f 72 20 6f | 63 63 75 72 72 65 64 2c | error o|ccurred,|
|00004780| 20 74 68 65 6e 20 65 78 | 69 74 20 74 68 65 20 70 | then ex|it the p|
|00004790| 72 6f 67 72 61 6d 2e 0d | 09 54 68 69 73 20 72 6f |rogram..|.This ro|
|000047a0| 75 74 69 6e 65 20 69 73 | 20 75 73 65 64 20 61 73 |utine is| used as|
|000047b0| 20 61 6e 20 75 6c 74 69 | 6d 61 74 65 20 62 61 69 | an ulti|mate bai|
|000047c0| 6c 2d 6f 75 74 20 66 6f | 72 20 73 65 72 69 6f 75 |l-out fo|r seriou|
|000047d0| 73 20 65 72 72 6f 72 73 | 20 74 68 61 74 20 70 72 |s errors| that pr|
|000047e0| 6f 68 69 62 69 74 0d 09 | 74 68 65 20 63 6f 6e 74 |ohibit..|the cont|
|000047f0| 69 6e 75 61 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |inuation| of the |
|00004800| 61 70 70 6c 69 63 61 74 | 69 6f 6e 2e 20 45 72 72 |applicat|ion. Err|
|00004810| 6f 72 73 20 74 68 61 74 | 20 64 6f 20 6e 6f 74 20 |ors that| do not |
|00004820| 72 65 71 75 69 72 65 20 | 74 68 65 20 74 65 72 6d |require |the term|
|00004830| 69 6e 61 74 69 6f 6e 0d | 09 6f 66 20 74 68 65 20 |ination.|.of the |
|00004840| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 73 68 6f 75 |applicat|ion shou|
|00004850| 6c 64 20 62 65 20 68 61 | 6e 64 6c 65 64 20 69 6e |ld be ha|ndled in|
|00004860| 20 61 20 64 69 66 66 65 | 72 65 6e 74 20 6d 61 6e | a diffe|rent man|
|00004870| 6e 65 72 2e 20 45 72 72 | 6f 72 20 63 68 65 63 6b |ner. Err|or check|
|00004880| 69 6e 67 20 61 6e 64 0d | 09 72 65 70 6f 72 74 69 |ing and.|.reporti|
|00004890| 6e 67 20 68 61 73 20 61 | 20 70 6c 61 63 65 20 65 |ng has a| place e|
|000048a0| 76 65 6e 20 69 6e 20 74 | 68 65 20 73 69 6d 70 6c |ven in t|he simpl|
|000048b0| 65 73 74 20 61 70 70 6c | 69 63 61 74 69 6f 6e 2e |est appl|ication.|
|000048c0| 20 54 68 65 20 65 72 72 | 6f 72 20 6e 75 6d 62 65 | The err|or numbe|
|000048d0| 72 20 69 73 20 75 73 65 | 64 0d 09 74 6f 20 69 6e |r is use|d..to in|
|000048e0| 64 65 78 20 61 6e 20 27 | 53 54 52 23 27 20 72 65 |dex an '|STR#' re|
|000048f0| 73 6f 75 72 63 65 20 73 | 6f 20 74 68 61 74 20 61 |source s|o that a|
|00004900| 20 72 65 6c 65 76 61 6e | 74 20 6d 65 73 73 61 67 | relevan|t messag|
|00004910| 65 20 63 61 6e 20 62 65 | 20 64 69 73 70 6c 61 79 |e can be| display|
|00004920| 65 64 2e 20 2a 2f 0d 0d | 23 70 72 61 67 6d 61 20 |ed. */..|#pragma |
|00004930| 73 65 67 6d 65 6e 74 20 | 4d 61 69 6e 0d 76 6f 69 |segment |Main.voi|
|00004940| 64 20 41 6c 65 72 74 55 | 73 65 72 28 29 0d 7b 0d |d AlertU|ser().{.|
|00004950| 09 73 68 6f 72 74 09 09 | 69 74 65 6d 48 69 74 3b |.short..|itemHit;|
|00004960| 0d 0d 09 53 65 74 43 75 | 72 73 6f 72 28 26 71 64 |...SetCu|rsor(&qd|
|00004970| 2e 61 72 72 6f 77 29 3b | 0d 09 69 74 65 6d 48 69 |.arrow);|..itemHi|
|00004980| 74 20 3d 20 41 6c 65 72 | 74 28 72 55 73 65 72 41 |t = Aler|t(rUserA|
|00004990| 6c 65 72 74 2c 20 6e 69 | 6c 29 3b 0d 09 45 78 69 |lert, ni|l);..Exi|
|000049a0| 74 54 6f 53 68 65 6c 6c | 28 29 3b 0d 7d 20 2f 2a |tToShell|();.} /*|
|000049b0| 20 41 6c 65 72 74 55 73 | 65 72 20 2a 2f 0d 0d 0d | AlertUs|er */...|
|000049c0| 09 0d 2f 2f 20 44 69 73 | 70 6c 61 79 20 61 6e 20 |..// Dis|play an |
|000049d0| 61 6c 65 72 74 20 74 6f | 20 74 65 6c 6c 20 74 68 |alert to| tell th|
|000049e0| 65 20 75 73 65 72 20 74 | 68 61 74 20 33 32 2d 62 |e user t|hat 32-b|
|000049f0| 69 74 20 51 75 69 63 6b | 44 72 61 77 20 69 73 20 |it Quick|Draw is |
|00004a00| 72 65 71 75 69 72 65 64 | 20 74 6f 20 0d 2f 2f 20 |required| to .// |
|00004a10| 72 75 6e 20 50 72 47 65 | 6e 65 72 61 6c 20 50 6c |run PrGe|neral Pl|
|00004a20| 61 79 2e 2e 2e 0d 0d 23 | 70 72 61 67 6d 61 20 73 |ay.....#|pragma s|
|00004a30| 65 67 6d 65 6e 74 20 4d | 61 69 6e 0d 76 6f 69 64 |egment M|ain.void|
|00004a40| 20 51 44 33 32 42 69 74 | 41 6c 65 72 74 55 73 65 | QD32Bit|AlertUse|
|00004a50| 72 28 29 0d 7b 0d 09 73 | 68 6f 72 74 09 09 69 74 |r().{..s|hort..it|
|00004a60| 65 6d 48 69 74 3b 0d 0d | 09 53 65 74 43 75 72 73 |emHit;..|.SetCurs|
|00004a70| 6f 72 28 26 71 64 2e 61 | 72 72 6f 77 29 3b 0d 09 |or(&qd.a|rrow);..|
|00004a80| 0d 09 69 74 65 6d 48 69 | 74 20 3d 20 41 6c 65 72 |..itemHi|t = Aler|
|00004a90| 74 28 72 33 32 42 69 74 | 51 44 41 6c 65 72 74 2c |t(r32Bit|QDAlert,|
|00004aa0| 20 6e 69 6c 29 3b 0d 09 | 45 78 69 74 54 6f 53 68 | nil);..|ExitToSh|
|00004ab0| 65 6c 6c 28 29 3b 0d 7d | 20 20 2f 2f 20 65 6e 64 |ell();.}| // end|
|00004ac0| 20 6f 66 20 51 44 33 32 | 42 69 74 41 6c 65 72 74 | of QD32|BitAlert|
|00004ad0| 55 73 65 72 0d 09 0d 0d | 09 0d 09 00 00 00 00 00 |User....|........|
|00004ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b00| 00 00 01 00 00 00 01 f0 | 00 00 00 f0 00 00 00 52 |........|.......R|
|00004b10| 43 6f 70 79 43 6c 65 61 | 72 20 3d 20 54 52 55 45 |CopyClea|r = TRUE|
|00004b20| 3b 0d 09 09 70 61 73 74 | 65 20 3d 20 54 52 55 45 |;...past|e = TRUE|
|00004b30| 0f 50 72 47 65 6e 65 72 | 61 6c 50 6c 61 79 2e 63 |.PrGener|alPlay.c|
|00004b40| 02 00 00 00 54 45 58 54 | 4d 50 53 20 01 00 00 00 |....TEXT|MPS ....|
|00004b50| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 00 00 80 |..TEXTMP|S ......|
|00004b60| 00 00 00 e6 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b70| 00 00 a0 c2 82 b0 00 00 | 4a 5b 00 00 02 42 29 5b |........|J[...B)[|
|00004b80| 30 5d 5b 30 5d 20 29 0d | 09 09 09 69 66 20 28 20 |0][0] ).|...if ( |
|00004b90| 73 65 6c 53 74 61 72 74 | 20 3c 20 73 65 6c 45 6e |selStart| < selEn|
|00004ba0| 64 20 29 0d 09 09 09 09 | 63 75 74 43 6f 70 79 43 |d ).....|cutCopyC|
|00004bb0| 6c 65 61 72 20 3d 20 54 | 52 55 45 3b 0d 09 09 09 |lear = T|RUE;....|
|00004bc0| 09 2f 2a 43 75 74 2c 20 | 43 6f 70 79 2c 20 61 6e |./*Cut, |Copy, an|
|00004bd0| 64 20 43 6c 65 61 72 20 | 69 73 20 65 6e 61 62 6c |d Clear |is enabl|
|00004be0| 65 64 20 66 6f 72 20 61 | 70 70 2e 20 77 69 6e 64 |ed for a|pp. wind|
|00004bf0| 6f 77 73 20 77 69 74 68 | 20 73 65 6c 65 63 74 69 |ows with| selecti|
|00004c00| 00 00 00 18 03 01 60 01 | 00 00 05 33 2e 31 42 31 |......`.|...3.1B1|
|00004c10| 0b 4d 50 57 20 43 20 33 | 2e 31 42 31 00 00 00 48 |.MPW C 3|.1B1...H|
|00004c20| 00 09 4d 6f 6e 61 63 6f | 00 00 01 d1 00 00 00 14 |..Monaco|........|
|00004c30| 00 01 21 a8 00 0a 00 00 | 00 00 00 00 00 00 01 d8 |..!.....|........|
|00004c40| 00 00 00 06 00 04 00 29 | 00 05 01 db 02 33 00 30 |.......)|.....3.0|
|00004c50| fe 05 03 7c 02 7b a2 91 | ca a7 00 00 00 00 00 00 |...|.{..|........|
|00004c60| 00 00 00 00 00 00 01 00 | 00 00 00 84 00 07 00 00 |........|........|
|00004c70| 06 1f 00 00 06 1f 05 56 | 61 72 73 00 00 00 0f 92 |.......V|ars.....|
|00004c80| 00 00 0f 9f 0d 57 61 69 | 74 4e 65 78 74 45 76 65 |.....Wai|tNextEve|
|00004c90| 6e 74 00 00 11 17 00 00 | 11 1e 07 44 6f 45 76 65 |nt......|...DoEve|
|00004ca0| 6e 74 00 00 18 33 00 00 | 18 3b 0d 6e 65 77 20 50 |nt...3..|.;.new P|
|00004cb0| 50 43 65 76 65 6e 74 00 | 00 00 21 52 00 00 21 5c |PCevent.|..!R..!\|
|00004cc0| 0b 6d 50 72 47 65 6e 65 | 72 61 6c 00 00 00 26 ce |.mPrGene|ral...&.|
|00004cd0| 00 00 26 db 0d 44 6f 4d | 65 6e 75 43 6f 6d 6d 61 |..&..DoM|enuComma|
|00004ce0| 6e 64 00 00 3a 24 00 00 | 3a 24 05 49 6e 69 74 00 |nd..:$..|:$.Init.|
|00004cf0| 00 00 01 00 00 00 01 f0 | 00 00 00 f0 00 00 00 52 |........|.......R|
|00004d00| 00 2b 1d b4 0c dc 00 00 | 00 1c 00 52 00 01 76 65 |.+......|...R..ve|
|00004d10| 72 73 00 00 00 12 4d 50 | 53 52 00 01 00 1e 00 02 |rs....MP|SR......|
|00004d20| ff ff 20 00 00 00 00 00 | 00 00 03 ed ff ff 00 00 |.. .....|........|
|00004d30| 00 1c 00 00 00 00 03 ef | ff ff 00 00 00 68 00 2c |........|.....h.,|
|00004d40| c3 84 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+